proteus  1.7.2
C/C++/Fortran libraries
BoundaryConditions.c
Go to the documentation of this file.
1 /* Generated by Cython 0.28.5 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6  #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8  #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_28_5"
11 #define CYTHON_FUTURE_DIVISION 0
12 #include <stddef.h>
13 #ifndef offsetof
14  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
15 #endif
16 #if !defined(WIN32) && !defined(MS_WINDOWS)
17  #ifndef __stdcall
18  #define __stdcall
19  #endif
20  #ifndef __cdecl
21  #define __cdecl
22  #endif
23  #ifndef __fastcall
24  #define __fastcall
25  #endif
26 #endif
27 #ifndef DL_IMPORT
28  #define DL_IMPORT(t) t
29 #endif
30 #ifndef DL_EXPORT
31  #define DL_EXPORT(t) t
32 #endif
33 #define __PYX_COMMA ,
34 #ifndef HAVE_LONG_LONG
35  #if PY_VERSION_HEX >= 0x02070000
36  #define HAVE_LONG_LONG
37  #endif
38 #endif
39 #ifndef PY_LONG_LONG
40  #define PY_LONG_LONG LONG_LONG
41 #endif
42 #ifndef Py_HUGE_VAL
43  #define Py_HUGE_VAL HUGE_VAL
44 #endif
45 #ifdef PYPY_VERSION
46  #define CYTHON_COMPILING_IN_PYPY 1
47  #define CYTHON_COMPILING_IN_PYSTON 0
48  #define CYTHON_COMPILING_IN_CPYTHON 0
49  #undef CYTHON_USE_TYPE_SLOTS
50  #define CYTHON_USE_TYPE_SLOTS 0
51  #undef CYTHON_USE_PYTYPE_LOOKUP
52  #define CYTHON_USE_PYTYPE_LOOKUP 0
53  #if PY_VERSION_HEX < 0x03050000
54  #undef CYTHON_USE_ASYNC_SLOTS
55  #define CYTHON_USE_ASYNC_SLOTS 0
56  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
57  #define CYTHON_USE_ASYNC_SLOTS 1
58  #endif
59  #undef CYTHON_USE_PYLIST_INTERNALS
60  #define CYTHON_USE_PYLIST_INTERNALS 0
61  #undef CYTHON_USE_UNICODE_INTERNALS
62  #define CYTHON_USE_UNICODE_INTERNALS 0
63  #undef CYTHON_USE_UNICODE_WRITER
64  #define CYTHON_USE_UNICODE_WRITER 0
65  #undef CYTHON_USE_PYLONG_INTERNALS
66  #define CYTHON_USE_PYLONG_INTERNALS 0
67  #undef CYTHON_AVOID_BORROWED_REFS
68  #define CYTHON_AVOID_BORROWED_REFS 1
69  #undef CYTHON_ASSUME_SAFE_MACROS
70  #define CYTHON_ASSUME_SAFE_MACROS 0
71  #undef CYTHON_UNPACK_METHODS
72  #define CYTHON_UNPACK_METHODS 0
73  #undef CYTHON_FAST_THREAD_STATE
74  #define CYTHON_FAST_THREAD_STATE 0
75  #undef CYTHON_FAST_PYCALL
76  #define CYTHON_FAST_PYCALL 0
77  #undef CYTHON_PEP489_MULTI_PHASE_INIT
78  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
79  #undef CYTHON_USE_TP_FINALIZE
80  #define CYTHON_USE_TP_FINALIZE 0
81 #elif defined(PYSTON_VERSION)
82  #define CYTHON_COMPILING_IN_PYPY 0
83  #define CYTHON_COMPILING_IN_PYSTON 1
84  #define CYTHON_COMPILING_IN_CPYTHON 0
85  #ifndef CYTHON_USE_TYPE_SLOTS
86  #define CYTHON_USE_TYPE_SLOTS 1
87  #endif
88  #undef CYTHON_USE_PYTYPE_LOOKUP
89  #define CYTHON_USE_PYTYPE_LOOKUP 0
90  #undef CYTHON_USE_ASYNC_SLOTS
91  #define CYTHON_USE_ASYNC_SLOTS 0
92  #undef CYTHON_USE_PYLIST_INTERNALS
93  #define CYTHON_USE_PYLIST_INTERNALS 0
94  #ifndef CYTHON_USE_UNICODE_INTERNALS
95  #define CYTHON_USE_UNICODE_INTERNALS 1
96  #endif
97  #undef CYTHON_USE_UNICODE_WRITER
98  #define CYTHON_USE_UNICODE_WRITER 0
99  #undef CYTHON_USE_PYLONG_INTERNALS
100  #define CYTHON_USE_PYLONG_INTERNALS 0
101  #ifndef CYTHON_AVOID_BORROWED_REFS
102  #define CYTHON_AVOID_BORROWED_REFS 0
103  #endif
104  #ifndef CYTHON_ASSUME_SAFE_MACROS
105  #define CYTHON_ASSUME_SAFE_MACROS 1
106  #endif
107  #ifndef CYTHON_UNPACK_METHODS
108  #define CYTHON_UNPACK_METHODS 1
109  #endif
110  #undef CYTHON_FAST_THREAD_STATE
111  #define CYTHON_FAST_THREAD_STATE 0
112  #undef CYTHON_FAST_PYCALL
113  #define CYTHON_FAST_PYCALL 0
114  #undef CYTHON_PEP489_MULTI_PHASE_INIT
115  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
116  #undef CYTHON_USE_TP_FINALIZE
117  #define CYTHON_USE_TP_FINALIZE 0
118 #else
119  #define CYTHON_COMPILING_IN_PYPY 0
120  #define CYTHON_COMPILING_IN_PYSTON 0
121  #define CYTHON_COMPILING_IN_CPYTHON 1
122  #ifndef CYTHON_USE_TYPE_SLOTS
123  #define CYTHON_USE_TYPE_SLOTS 1
124  #endif
125  #if PY_VERSION_HEX < 0x02070000
126  #undef CYTHON_USE_PYTYPE_LOOKUP
127  #define CYTHON_USE_PYTYPE_LOOKUP 0
128  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
129  #define CYTHON_USE_PYTYPE_LOOKUP 1
130  #endif
131  #if PY_MAJOR_VERSION < 3
132  #undef CYTHON_USE_ASYNC_SLOTS
133  #define CYTHON_USE_ASYNC_SLOTS 0
134  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
135  #define CYTHON_USE_ASYNC_SLOTS 1
136  #endif
137  #if PY_VERSION_HEX < 0x02070000
138  #undef CYTHON_USE_PYLONG_INTERNALS
139  #define CYTHON_USE_PYLONG_INTERNALS 0
140  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
141  #define CYTHON_USE_PYLONG_INTERNALS 1
142  #endif
143  #ifndef CYTHON_USE_PYLIST_INTERNALS
144  #define CYTHON_USE_PYLIST_INTERNALS 1
145  #endif
146  #ifndef CYTHON_USE_UNICODE_INTERNALS
147  #define CYTHON_USE_UNICODE_INTERNALS 1
148  #endif
149  #if PY_VERSION_HEX < 0x030300F0
150  #undef CYTHON_USE_UNICODE_WRITER
151  #define CYTHON_USE_UNICODE_WRITER 0
152  #elif !defined(CYTHON_USE_UNICODE_WRITER)
153  #define CYTHON_USE_UNICODE_WRITER 1
154  #endif
155  #ifndef CYTHON_AVOID_BORROWED_REFS
156  #define CYTHON_AVOID_BORROWED_REFS 0
157  #endif
158  #ifndef CYTHON_ASSUME_SAFE_MACROS
159  #define CYTHON_ASSUME_SAFE_MACROS 1
160  #endif
161  #ifndef CYTHON_UNPACK_METHODS
162  #define CYTHON_UNPACK_METHODS 1
163  #endif
164  #ifndef CYTHON_FAST_THREAD_STATE
165  #define CYTHON_FAST_THREAD_STATE 1
166  #endif
167  #ifndef CYTHON_FAST_PYCALL
168  #define CYTHON_FAST_PYCALL 1
169  #endif
170  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
171  #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
172  #endif
173  #ifndef CYTHON_USE_TP_FINALIZE
174  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
175  #endif
176 #endif
177 #if !defined(CYTHON_FAST_PYCCALL)
178 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
179 #endif
180 #if CYTHON_USE_PYLONG_INTERNALS
181  #include "longintrepr.h"
182  #undef SHIFT
183  #undef BASE
184  #undef MASK
185 #endif
186 #ifndef __has_attribute
187  #define __has_attribute(x) 0
188 #endif
189 #ifndef __has_cpp_attribute
190  #define __has_cpp_attribute(x) 0
191 #endif
192 #ifndef CYTHON_RESTRICT
193  #if defined(__GNUC__)
194  #define CYTHON_RESTRICT __restrict__
195  #elif defined(_MSC_VER) && _MSC_VER >= 1400
196  #define CYTHON_RESTRICT __restrict
197  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
198  #define CYTHON_RESTRICT restrict
199  #else
200  #define CYTHON_RESTRICT
201  #endif
202 #endif
203 #ifndef CYTHON_UNUSED
204 # if defined(__GNUC__)
205 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
206 # define CYTHON_UNUSED __attribute__ ((__unused__))
207 # else
208 # define CYTHON_UNUSED
209 # endif
210 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
211 # define CYTHON_UNUSED __attribute__ ((__unused__))
212 # else
213 # define CYTHON_UNUSED
214 # endif
215 #endif
216 #ifndef CYTHON_MAYBE_UNUSED_VAR
217 # if defined(__cplusplus)
218  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
219 # else
220 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
221 # endif
222 #endif
223 #ifndef CYTHON_NCP_UNUSED
224 # if CYTHON_COMPILING_IN_CPYTHON
225 # define CYTHON_NCP_UNUSED
226 # else
227 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
228 # endif
229 #endif
230 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
231 #ifdef _MSC_VER
232  #ifndef _MSC_STDINT_H_
233  #if _MSC_VER < 1300
234  typedef unsigned char uint8_t;
235  typedef unsigned int uint32_t;
236  #else
237  typedef unsigned __int8 uint8_t;
238  typedef unsigned __int32 uint32_t;
239  #endif
240  #endif
241 #else
242  #include <stdint.h>
243 #endif
244 #ifndef CYTHON_FALLTHROUGH
245  #if defined(__cplusplus) && __cplusplus >= 201103L
246  #if __has_cpp_attribute(fallthrough)
247  #define CYTHON_FALLTHROUGH [[fallthrough]]
248  #elif __has_cpp_attribute(clang::fallthrough)
249  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
250  #elif __has_cpp_attribute(gnu::fallthrough)
251  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
252  #endif
253  #endif
254  #ifndef CYTHON_FALLTHROUGH
255  #if __has_attribute(fallthrough)
256  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
257  #else
258  #define CYTHON_FALLTHROUGH
259  #endif
260  #endif
261  #if defined(__clang__ ) && defined(__apple_build_version__)
262  #if __apple_build_version__ < 7000000
263  #undef CYTHON_FALLTHROUGH
264  #define CYTHON_FALLTHROUGH
265  #endif
266  #endif
267 #endif
268 
269 #ifndef CYTHON_INLINE
270  #if defined(__clang__)
271  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
272  #elif defined(__GNUC__)
273  #define CYTHON_INLINE __inline__
274  #elif defined(_MSC_VER)
275  #define CYTHON_INLINE __inline
276  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
277  #define CYTHON_INLINE inline
278  #else
279  #define CYTHON_INLINE
280  #endif
281 #endif
282 
283 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
284  #define Py_OptimizeFlag 0
285 #endif
286 #define __PYX_BUILD_PY_SSIZE_T "n"
287 #define CYTHON_FORMAT_SSIZE_T "z"
288 #if PY_MAJOR_VERSION < 3
289  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
290  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
291  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
292  #define __Pyx_DefaultClassType PyClass_Type
293 #else
294  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
295  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
296  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
297  #define __Pyx_DefaultClassType PyType_Type
298 #endif
299 #ifndef Py_TPFLAGS_CHECKTYPES
300  #define Py_TPFLAGS_CHECKTYPES 0
301 #endif
302 #ifndef Py_TPFLAGS_HAVE_INDEX
303  #define Py_TPFLAGS_HAVE_INDEX 0
304 #endif
305 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
306  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
307 #endif
308 #ifndef Py_TPFLAGS_HAVE_FINALIZE
309  #define Py_TPFLAGS_HAVE_FINALIZE 0
310 #endif
311 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
312  #ifndef METH_FASTCALL
313  #define METH_FASTCALL 0x80
314  #endif
315  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
316  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
317  Py_ssize_t nargs, PyObject *kwnames);
318 #else
319  #define __Pyx_PyCFunctionFast _PyCFunctionFast
320  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
321 #endif
322 #if CYTHON_FAST_PYCCALL
323 #define __Pyx_PyFastCFunction_Check(func)\
324  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
325 #else
326 #define __Pyx_PyFastCFunction_Check(func) 0
327 #endif
328 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
329  #define PyObject_Malloc(s) PyMem_Malloc(s)
330  #define PyObject_Free(p) PyMem_Free(p)
331  #define PyObject_Realloc(p) PyMem_Realloc(p)
332 #endif
333 #if CYTHON_COMPILING_IN_PYSTON
334  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
335  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
336 #else
337  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
338  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
339 #endif
340 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
341  #define __Pyx_PyThreadState_Current PyThreadState_GET()
342 #elif PY_VERSION_HEX >= 0x03060000
343  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
344 #elif PY_VERSION_HEX >= 0x03000000
345  #define __Pyx_PyThreadState_Current PyThreadState_GET()
346 #else
347  #define __Pyx_PyThreadState_Current _PyThreadState_Current
348 #endif
349 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
350 #include "pythread.h"
351 #define Py_tss_NEEDS_INIT 0
352 typedef int Py_tss_t;
353 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
354  *key = PyThread_create_key();
355  return 0; // PyThread_create_key reports success always
356 }
357 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
358  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
359  *key = Py_tss_NEEDS_INIT;
360  return key;
361 }
362 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
363  PyObject_Free(key);
364 }
365 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
366  return *key != Py_tss_NEEDS_INIT;
367 }
368 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
369  PyThread_delete_key(*key);
370  *key = Py_tss_NEEDS_INIT;
371 }
372 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
373  return PyThread_set_key_value(*key, value);
374 }
375 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
376  return PyThread_get_key_value(*key);
377 }
378 #endif // TSS (Thread Specific Storage) API
379 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
380 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
381 #else
382 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
383 #endif
384 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
385  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
386  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
387 #else
388  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
389  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
390 #endif
391 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
392 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
393 #else
394 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
395 #endif
396 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
397  #define CYTHON_PEP393_ENABLED 1
398  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
399  0 : _PyUnicode_Ready((PyObject *)(op)))
400  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
401  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
402  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
403  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
404  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
405  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
406  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
407  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
408 #else
409  #define CYTHON_PEP393_ENABLED 0
410  #define PyUnicode_1BYTE_KIND 1
411  #define PyUnicode_2BYTE_KIND 2
412  #define PyUnicode_4BYTE_KIND 4
413  #define __Pyx_PyUnicode_READY(op) (0)
414  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
415  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
416  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
417  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
418  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
419  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
420  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
421  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
422 #endif
423 #if CYTHON_COMPILING_IN_PYPY
424  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
425  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
426 #else
427  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
428  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
429  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
430 #endif
431 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
432  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
433 #endif
434 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
435  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
436 #endif
437 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
438  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
439 #endif
440 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
441 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
442 #if PY_MAJOR_VERSION >= 3
443  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
444 #else
445  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
446 #endif
447 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
448  #define PyObject_ASCII(o) PyObject_Repr(o)
449 #endif
450 #if PY_MAJOR_VERSION >= 3
451  #define PyBaseString_Type PyUnicode_Type
452  #define PyStringObject PyUnicodeObject
453  #define PyString_Type PyUnicode_Type
454  #define PyString_Check PyUnicode_Check
455  #define PyString_CheckExact PyUnicode_CheckExact
456  #define PyObject_Unicode PyObject_Str
457 #endif
458 #if PY_MAJOR_VERSION >= 3
459  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
460  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
461 #else
462  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
463  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
464 #endif
465 #ifndef PySet_CheckExact
466  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
467 #endif
468 #if CYTHON_ASSUME_SAFE_MACROS
469  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
470 #else
471  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
472 #endif
473 #if PY_MAJOR_VERSION >= 3
474  #define PyIntObject PyLongObject
475  #define PyInt_Type PyLong_Type
476  #define PyInt_Check(op) PyLong_Check(op)
477  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
478  #define PyInt_FromString PyLong_FromString
479  #define PyInt_FromUnicode PyLong_FromUnicode
480  #define PyInt_FromLong PyLong_FromLong
481  #define PyInt_FromSize_t PyLong_FromSize_t
482  #define PyInt_FromSsize_t PyLong_FromSsize_t
483  #define PyInt_AsLong PyLong_AsLong
484  #define PyInt_AS_LONG PyLong_AS_LONG
485  #define PyInt_AsSsize_t PyLong_AsSsize_t
486  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
487  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
488  #define PyNumber_Int PyNumber_Long
489 #endif
490 #if PY_MAJOR_VERSION >= 3
491  #define PyBoolObject PyLongObject
492 #endif
493 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
494  #ifndef PyUnicode_InternFromString
495  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
496  #endif
497 #endif
498 #if PY_VERSION_HEX < 0x030200A4
499  typedef long Py_hash_t;
500  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
501  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
502 #else
503  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
504  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
505 #endif
506 #if PY_MAJOR_VERSION >= 3
507  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
508 #else
509  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
510 #endif
511 #if CYTHON_USE_ASYNC_SLOTS
512  #if PY_VERSION_HEX >= 0x030500B1
513  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
514  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
515  #else
516  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
517  #endif
518 #else
519  #define __Pyx_PyType_AsAsync(obj) NULL
520 #endif
521 #ifndef __Pyx_PyAsyncMethodsStruct
522  typedef struct {
523  unaryfunc am_await;
524  unaryfunc am_aiter;
525  unaryfunc am_anext;
526  } __Pyx_PyAsyncMethodsStruct;
527 #endif
528 
529 #if defined(WIN32) || defined(MS_WINDOWS)
530  #define _USE_MATH_DEFINES
531 #endif
532 #include <math.h>
533 #ifdef NAN
534 #define __PYX_NAN() ((float) NAN)
535 #else
536 static CYTHON_INLINE float __PYX_NAN() {
537  float value;
538  memset(&value, 0xFF, sizeof(value));
539  return value;
540 }
541 #endif
542 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
543 #define __Pyx_truncl trunc
544 #else
545 #define __Pyx_truncl truncl
546 #endif
547 
548 
549 #define __PYX_ERR(f_index, lineno, Ln_error) \
550 { \
551  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
552 }
553 
554 #ifndef __PYX_EXTERN_C
555  #ifdef __cplusplus
556  #define __PYX_EXTERN_C extern "C"
557  #else
558  #define __PYX_EXTERN_C extern
559  #endif
560 #endif
561 
562 #define __PYX_HAVE__BoundaryConditions
563 #define __PYX_HAVE_API__BoundaryConditions
564 /* Early includes */
565 #include <string.h>
566 #include <stdio.h>
567 #include "numpy/arrayobject.h"
568 #include "numpy/ufuncobject.h"
569 #include "pythread.h"
570 #include <stdlib.h>
571 #include "pystate.h"
572 #ifdef _OPENMP
573 #include <omp.h>
574 #endif /* _OPENMP */
575 
576 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
577 #define CYTHON_WITHOUT_ASSERTIONS
578 #endif
579 
580 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
581  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
582 
583 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
584 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
585 #define __PYX_DEFAULT_STRING_ENCODING ""
586 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
587 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
588 #define __Pyx_uchar_cast(c) ((unsigned char)c)
589 #define __Pyx_long_cast(x) ((long)x)
590 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
591  (sizeof(type) < sizeof(Py_ssize_t)) ||\
592  (sizeof(type) > sizeof(Py_ssize_t) &&\
593  likely(v < (type)PY_SSIZE_T_MAX ||\
594  v == (type)PY_SSIZE_T_MAX) &&\
595  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
596  v == (type)PY_SSIZE_T_MIN))) ||\
597  (sizeof(type) == sizeof(Py_ssize_t) &&\
598  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
599  v == (type)PY_SSIZE_T_MAX))) )
600 #if defined (__cplusplus) && __cplusplus >= 201103L
601  #include <cstdlib>
602  #define __Pyx_sst_abs(value) std::abs(value)
603 #elif SIZEOF_INT >= SIZEOF_SIZE_T
604  #define __Pyx_sst_abs(value) abs(value)
605 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
606  #define __Pyx_sst_abs(value) labs(value)
607 #elif defined (_MSC_VER)
608  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
609 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
610  #define __Pyx_sst_abs(value) llabs(value)
611 #elif defined (__GNUC__)
612  #define __Pyx_sst_abs(value) __builtin_llabs(value)
613 #else
614  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
615 #endif
616 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
617 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
618 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
619 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
620 #define __Pyx_PyBytes_FromString PyBytes_FromString
621 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
622 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
623 #if PY_MAJOR_VERSION < 3
624  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
625  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
626 #else
627  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
628  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
629 #endif
630 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
635 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
636 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
639 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
640 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
641 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
642 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
643 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
644 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
645 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
646 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
647  const Py_UNICODE *u_end = u;
648  while (*u_end++) ;
649  return (size_t)(u_end - u - 1);
650 }
651 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
652 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
653 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
654 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
655 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
656 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
657 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
658 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
659 #define __Pyx_PySequence_Tuple(obj)\
660  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
661 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
662 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
663 #if CYTHON_ASSUME_SAFE_MACROS
664 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
665 #else
666 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
667 #endif
668 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
669 #if PY_MAJOR_VERSION >= 3
670 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
671 #else
672 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
673 #endif
674 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
675 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
676 static int __Pyx_sys_getdefaultencoding_not_ascii;
677 static int __Pyx_init_sys_getdefaultencoding_params(void) {
678  PyObject* sys;
679  PyObject* default_encoding = NULL;
680  PyObject* ascii_chars_u = NULL;
681  PyObject* ascii_chars_b = NULL;
682  const char* default_encoding_c;
683  sys = PyImport_ImportModule("sys");
684  if (!sys) goto bad;
685  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
686  Py_DECREF(sys);
687  if (!default_encoding) goto bad;
688  default_encoding_c = PyBytes_AsString(default_encoding);
689  if (!default_encoding_c) goto bad;
690  if (strcmp(default_encoding_c, "ascii") == 0) {
691  __Pyx_sys_getdefaultencoding_not_ascii = 0;
692  } else {
693  char ascii_chars[128];
694  int c;
695  for (c = 0; c < 128; c++) {
696  ascii_chars[c] = c;
697  }
698  __Pyx_sys_getdefaultencoding_not_ascii = 1;
699  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
700  if (!ascii_chars_u) goto bad;
701  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
702  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
703  PyErr_Format(
704  PyExc_ValueError,
705  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
706  default_encoding_c);
707  goto bad;
708  }
709  Py_DECREF(ascii_chars_u);
710  Py_DECREF(ascii_chars_b);
711  }
712  Py_DECREF(default_encoding);
713  return 0;
714 bad:
715  Py_XDECREF(default_encoding);
716  Py_XDECREF(ascii_chars_u);
717  Py_XDECREF(ascii_chars_b);
718  return -1;
719 }
720 #endif
721 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
722 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
723 #else
724 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
725 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
726 static char* __PYX_DEFAULT_STRING_ENCODING;
727 static int __Pyx_init_sys_getdefaultencoding_params(void) {
728  PyObject* sys;
729  PyObject* default_encoding = NULL;
730  char* default_encoding_c;
731  sys = PyImport_ImportModule("sys");
732  if (!sys) goto bad;
733  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
734  Py_DECREF(sys);
735  if (!default_encoding) goto bad;
736  default_encoding_c = PyBytes_AsString(default_encoding);
737  if (!default_encoding_c) goto bad;
738  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
739  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
740  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
741  Py_DECREF(default_encoding);
742  return 0;
743 bad:
744  Py_XDECREF(default_encoding);
745  return -1;
746 }
747 #endif
748 #endif
749 
750 
751 /* Test for GCC > 2.95 */
752 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
753  #define likely(x) __builtin_expect(!!(x), 1)
754  #define unlikely(x) __builtin_expect(!!(x), 0)
755 #else /* !__GNUC__ or GCC < 2.95 */
756  #define likely(x) (x)
757  #define unlikely(x) (x)
758 #endif /* __GNUC__ */
759 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
760 
761 static PyObject *__pyx_m = NULL;
762 static PyObject *__pyx_d;
763 static PyObject *__pyx_b;
764 static PyObject *__pyx_cython_runtime = NULL;
765 static PyObject *__pyx_empty_tuple;
766 static PyObject *__pyx_empty_bytes;
767 static PyObject *__pyx_empty_unicode;
768 static int __pyx_lineno;
769 static int __pyx_clineno = 0;
770 static const char * __pyx_cfilenm= __FILE__;
771 static const char *__pyx_filename;
772 
773 /* Header.proto */
774 #if !defined(CYTHON_CCOMPLEX)
775  #if defined(__cplusplus)
776  #define CYTHON_CCOMPLEX 1
777  #elif defined(_Complex_I)
778  #define CYTHON_CCOMPLEX 1
779  #else
780  #define CYTHON_CCOMPLEX 0
781  #endif
782 #endif
783 #if CYTHON_CCOMPLEX
784  #ifdef __cplusplus
785  #include <complex>
786  #else
787  #include <complex.h>
788  #endif
789 #endif
790 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
791  #undef _Complex_I
792  #define _Complex_I 1.0fj
793 #endif
794 
795 
796 static const char *__pyx_f[] = {
797  "proteus/BoundaryConditions.py",
798  "stringsource",
799  "proteus/BoundaryConditions.pxd",
800  "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd",
801  "linux2/lib/python2.7/site-packages/Cython/Includes/cpython/type.pxd",
802 };
803 /* MemviewSliceStruct.proto */
804 struct __pyx_memoryview_obj;
805 typedef struct {
806  struct __pyx_memoryview_obj *memview;
807  char *data;
808  Py_ssize_t shape[8];
809  Py_ssize_t strides[8];
810  Py_ssize_t suboffsets[8];
811 } __Pyx_memviewslice;
812 #define __Pyx_MemoryView_Len(m) (m.shape[0])
813 
814 /* Atomics.proto */
815 #include <pythread.h>
816 #ifndef CYTHON_ATOMICS
817  #define CYTHON_ATOMICS 1
818 #endif
819 #define __pyx_atomic_int_type int
820 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
821  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
822  !defined(__i386__)
823  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
824  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
825  #ifdef __PYX_DEBUG_ATOMICS
826  #warning "Using GNU atomics"
827  #endif
828 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
829  #include <Windows.h>
830  #undef __pyx_atomic_int_type
831  #define __pyx_atomic_int_type LONG
832  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
833  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
834  #ifdef __PYX_DEBUG_ATOMICS
835  #pragma message ("Using MSVC atomics")
836  #endif
837 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
838  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
839  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
840  #ifdef __PYX_DEBUG_ATOMICS
841  #warning "Using Intel atomics"
842  #endif
843 #else
844  #undef CYTHON_ATOMICS
845  #define CYTHON_ATOMICS 0
846  #ifdef __PYX_DEBUG_ATOMICS
847  #warning "Not using atomics"
848  #endif
849 #endif
850 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
851 #if CYTHON_ATOMICS
852  #define __pyx_add_acquisition_count(memview)\
853  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
854  #define __pyx_sub_acquisition_count(memview)\
855  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
856 #else
857  #define __pyx_add_acquisition_count(memview)\
858  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
859  #define __pyx_sub_acquisition_count(memview)\
860  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
861 #endif
862 
863 /* ForceInitThreads.proto */
864 #ifndef __PYX_FORCE_INIT_THREADS
865  #define __PYX_FORCE_INIT_THREADS 0
866 #endif
867 
868 /* NoFastGil.proto */
869 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
870 #define __Pyx_PyGILState_Release PyGILState_Release
871 #define __Pyx_FastGIL_Remember()
872 #define __Pyx_FastGIL_Forget()
873 #define __Pyx_FastGilFuncInit()
874 
875 /* BufferFormatStructs.proto */
876 #define IS_UNSIGNED(type) (((type) -1) > 0)
877 struct __Pyx_StructField_;
878 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
879 typedef struct {
880  const char* name;
881  struct __Pyx_StructField_* fields;
882  size_t size;
883  size_t arraysize[8];
884  int ndim;
885  char typegroup;
886  char is_unsigned;
887  int flags;
888 } __Pyx_TypeInfo;
889 typedef struct __Pyx_StructField_ {
890  __Pyx_TypeInfo* type;
891  const char* name;
892  size_t offset;
893 } __Pyx_StructField;
894 typedef struct {
895  __Pyx_StructField* field;
896  size_t parent_offset;
897 } __Pyx_BufFmt_StackElem;
898 typedef struct {
899  __Pyx_StructField root;
900  __Pyx_BufFmt_StackElem* head;
901  size_t fmt_offset;
902  size_t new_count, enc_count;
903  size_t struct_alignment;
904  int is_complex;
905  char enc_type;
906  char new_packmode;
907  char enc_packmode;
908  char is_valid_array;
909 } __Pyx_BufFmt_Context;
910 
911 
912 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730
913  * # in Cython to enable them only on the right systems.
914  *
915  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
916  * ctypedef npy_int16 int16_t
917  * ctypedef npy_int32 int32_t
918  */
919 typedef npy_int8 __pyx_t_5numpy_int8_t;
920 
921 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731
922  *
923  * ctypedef npy_int8 int8_t
924  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
925  * ctypedef npy_int32 int32_t
926  * ctypedef npy_int64 int64_t
927  */
928 typedef npy_int16 __pyx_t_5numpy_int16_t;
929 
930 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
931  * ctypedef npy_int8 int8_t
932  * ctypedef npy_int16 int16_t
933  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
934  * ctypedef npy_int64 int64_t
935  * #ctypedef npy_int96 int96_t
936  */
937 typedef npy_int32 __pyx_t_5numpy_int32_t;
938 
939 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
940  * ctypedef npy_int16 int16_t
941  * ctypedef npy_int32 int32_t
942  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
943  * #ctypedef npy_int96 int96_t
944  * #ctypedef npy_int128 int128_t
945  */
946 typedef npy_int64 __pyx_t_5numpy_int64_t;
947 
948 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737
949  * #ctypedef npy_int128 int128_t
950  *
951  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
952  * ctypedef npy_uint16 uint16_t
953  * ctypedef npy_uint32 uint32_t
954  */
955 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
956 
957 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738
958  *
959  * ctypedef npy_uint8 uint8_t
960  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
961  * ctypedef npy_uint32 uint32_t
962  * ctypedef npy_uint64 uint64_t
963  */
964 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
965 
966 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":739
967  * ctypedef npy_uint8 uint8_t
968  * ctypedef npy_uint16 uint16_t
969  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
970  * ctypedef npy_uint64 uint64_t
971  * #ctypedef npy_uint96 uint96_t
972  */
973 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
974 
975 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740
976  * ctypedef npy_uint16 uint16_t
977  * ctypedef npy_uint32 uint32_t
978  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
979  * #ctypedef npy_uint96 uint96_t
980  * #ctypedef npy_uint128 uint128_t
981  */
982 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
983 
984 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":744
985  * #ctypedef npy_uint128 uint128_t
986  *
987  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
988  * ctypedef npy_float64 float64_t
989  * #ctypedef npy_float80 float80_t
990  */
991 typedef npy_float32 __pyx_t_5numpy_float32_t;
992 
993 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":745
994  *
995  * ctypedef npy_float32 float32_t
996  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
997  * #ctypedef npy_float80 float80_t
998  * #ctypedef npy_float128 float128_t
999  */
1000 typedef npy_float64 __pyx_t_5numpy_float64_t;
1001 
1002 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754
1003  * # The int types are mapped a bit surprising --
1004  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1005  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1006  * ctypedef npy_longlong long_t
1007  * ctypedef npy_longlong longlong_t
1008  */
1009 typedef npy_long __pyx_t_5numpy_int_t;
1010 
1011 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
1012  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1013  * ctypedef npy_long int_t
1014  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1015  * ctypedef npy_longlong longlong_t
1016  *
1017  */
1018 typedef npy_longlong __pyx_t_5numpy_long_t;
1019 
1020 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756
1021  * ctypedef npy_long int_t
1022  * ctypedef npy_longlong long_t
1023  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1024  *
1025  * ctypedef npy_ulong uint_t
1026  */
1027 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1028 
1029 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
1030  * ctypedef npy_longlong longlong_t
1031  *
1032  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1033  * ctypedef npy_ulonglong ulong_t
1034  * ctypedef npy_ulonglong ulonglong_t
1035  */
1036 typedef npy_ulong __pyx_t_5numpy_uint_t;
1037 
1038 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759
1039  *
1040  * ctypedef npy_ulong uint_t
1041  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1042  * ctypedef npy_ulonglong ulonglong_t
1043  *
1044  */
1045 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1046 
1047 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
1048  * ctypedef npy_ulong uint_t
1049  * ctypedef npy_ulonglong ulong_t
1050  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1051  *
1052  * ctypedef npy_intp intp_t
1053  */
1054 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1055 
1056 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
1057  * ctypedef npy_ulonglong ulonglong_t
1058  *
1059  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1060  * ctypedef npy_uintp uintp_t
1061  *
1062  */
1063 typedef npy_intp __pyx_t_5numpy_intp_t;
1064 
1065 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763
1066  *
1067  * ctypedef npy_intp intp_t
1068  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1069  *
1070  * ctypedef npy_double float_t
1071  */
1072 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1073 
1074 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765
1075  * ctypedef npy_uintp uintp_t
1076  *
1077  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1078  * ctypedef npy_double double_t
1079  * ctypedef npy_longdouble longdouble_t
1080  */
1081 typedef npy_double __pyx_t_5numpy_float_t;
1082 
1083 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
1084  *
1085  * ctypedef npy_double float_t
1086  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1087  * ctypedef npy_longdouble longdouble_t
1088  *
1089  */
1090 typedef npy_double __pyx_t_5numpy_double_t;
1091 
1092 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":767
1093  * ctypedef npy_double float_t
1094  * ctypedef npy_double double_t
1095  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1096  *
1097  * ctypedef npy_cfloat cfloat_t
1098  */
1099 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1100 /* Declarations.proto */
1101 #if CYTHON_CCOMPLEX
1102  #ifdef __cplusplus
1103  typedef ::std::complex< float > __pyx_t_float_complex;
1104  #else
1105  typedef float _Complex __pyx_t_float_complex;
1106  #endif
1107 #else
1108  typedef struct { float real, imag; } __pyx_t_float_complex;
1109 #endif
1110 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1111 
1112 /* Declarations.proto */
1113 #if CYTHON_CCOMPLEX
1114  #ifdef __cplusplus
1115  typedef ::std::complex< double > __pyx_t_double_complex;
1116  #else
1117  typedef double _Complex __pyx_t_double_complex;
1118  #endif
1119 #else
1120  typedef struct { double real, imag; } __pyx_t_double_complex;
1121 #endif
1122 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1123 
1124 
1125 /*--- Type declarations ---*/
1126 struct __pyx_obj_18BoundaryConditions_BC_Base;
1127 struct __pyx_obj_18BoundaryConditions_BoundaryCondition;
1128 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC;
1129 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
1130 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
1131 struct __pyx_array_obj;
1132 struct __pyx_MemviewEnum_obj;
1133 struct __pyx_memoryview_obj;
1134 struct __pyx_memoryviewslice_obj;
1135 
1136 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769
1137  * ctypedef npy_longdouble longdouble_t
1138  *
1139  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1140  * ctypedef npy_cdouble cdouble_t
1141  * ctypedef npy_clongdouble clongdouble_t
1142  */
1143 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1144 
1145 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770
1146  *
1147  * ctypedef npy_cfloat cfloat_t
1148  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1149  * ctypedef npy_clongdouble clongdouble_t
1150  *
1151  */
1152 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1153 
1154 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
1155  * ctypedef npy_cfloat cfloat_t
1156  * ctypedef npy_cdouble cdouble_t
1157  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1158  *
1159  * ctypedef npy_cdouble complex_t
1160  */
1161 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1162 
1163 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773
1164  * ctypedef npy_clongdouble clongdouble_t
1165  *
1166  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1167  *
1168  * cdef inline object PyArray_MultiIterNew1(a):
1169  */
1170 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1171 
1172 /* "BoundaryConditions.pxd":16
1173  * # cpdef void getContext(BC_Base cls, object context=*)
1174  *
1175  * ctypedef double (*cpp_uOfXT) (BoundaryCondition, double[:], double) # <<<<<<<<<<<<<<
1176  * cdef class BoundaryCondition:
1177  * cdef cpp_uOfXT uuOfXT
1178  */
1179 typedef double (*__pyx_t_18BoundaryConditions_cpp_uOfXT)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, __Pyx_memviewslice, double);
1180 
1181 /* "BoundaryConditions.pxd":5
1182  * import cython
1183  *
1184  * cdef class BC_Base: # <<<<<<<<<<<<<<
1185  * cdef double[:] _b_or
1186  * cdef public:
1187  */
1188 struct __pyx_obj_18BoundaryConditions_BC_Base {
1189  PyObject_HEAD
1190  __Pyx_memviewslice _b_or;
1191  int nd;
1192  PyObject *Shape;
1193  PyObject *name;
1194  PyObject *BC_type;
1195  PyObject *ct;
1196 };
1197 
1198 
1199 /* "BoundaryConditions.pxd":17
1200  *
1201  * ctypedef double (*cpp_uOfXT) (BoundaryCondition, double[:], double)
1202  * cdef class BoundaryCondition: # <<<<<<<<<<<<<<
1203  * cdef cpp_uOfXT uuOfXT
1204  * cdef public:
1205  */
1206 struct __pyx_obj_18BoundaryConditions_BoundaryCondition {
1207  PyObject_HEAD
1208  struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtab;
1209  __pyx_t_18BoundaryConditions_cpp_uOfXT uuOfXT;
1210  PyObject *uOfXT;
1211 };
1212 
1213 
1214 /* "BoundaryConditions.py":76
1215  * self.uOfXT = None
1216  *
1217  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
1218  * """
1219  * function returning constant BC
1220  */
1221 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC {
1222  PyObject_HEAD
1223  PyObject *__pyx_v_value;
1224 };
1225 
1226 
1227 /* "BoundaryConditions.py":89
1228  *
1229  *
1230  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
1231  * """
1232  * function returning value=a0+ax*x+ay*y+az*z
1233  */
1234 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC {
1235  PyObject_HEAD
1236  PyObject *__pyx_v_a;
1237  PyObject *__pyx_v_a0;
1238 };
1239 
1240 
1241 /* "BoundaryConditions.py":104
1242  * self.uOfXT = lambda x, t: a0+sum(a[:]*x[:])
1243  *
1244  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
1245  * """
1246  * function setting a linear ramp from t=0 to t=t1
1247  */
1248 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp {
1249  PyObject_HEAD
1250  PyObject *__pyx_v_t1;
1251  PyObject *__pyx_v_value;
1252 };
1253 
1254 
1255 /* "View.MemoryView":104
1256  *
1257  * @cname("__pyx_array")
1258  * cdef class array: # <<<<<<<<<<<<<<
1259  *
1260  * cdef:
1261  */
1262 struct __pyx_array_obj {
1263  PyObject_HEAD
1264  struct __pyx_vtabstruct_array *__pyx_vtab;
1265  char *data;
1266  Py_ssize_t len;
1267  char *format;
1268  int ndim;
1269  Py_ssize_t *_shape;
1270  Py_ssize_t *_strides;
1271  Py_ssize_t itemsize;
1272  PyObject *mode;
1273  PyObject *_format;
1274  void (*callback_free_data)(void *);
1275  int free_data;
1276  int dtype_is_object;
1277 };
1278 
1279 
1280 /* "View.MemoryView":278
1281  *
1282  * @cname('__pyx_MemviewEnum')
1283  * cdef class Enum(object): # <<<<<<<<<<<<<<
1284  * cdef object name
1285  * def __init__(self, name):
1286  */
1287 struct __pyx_MemviewEnum_obj {
1288  PyObject_HEAD
1289  PyObject *name;
1290 };
1291 
1292 
1293 /* "View.MemoryView":329
1294  *
1295  * @cname('__pyx_memoryview')
1296  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1297  *
1298  * cdef object obj
1299  */
1300 struct __pyx_memoryview_obj {
1301  PyObject_HEAD
1302  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1303  PyObject *obj;
1304  PyObject *_size;
1305  PyObject *_array_interface;
1306  PyThread_type_lock lock;
1307  __pyx_atomic_int acquisition_count[2];
1308  __pyx_atomic_int *acquisition_count_aligned_p;
1309  Py_buffer view;
1310  int flags;
1311  int dtype_is_object;
1312  __Pyx_TypeInfo *typeinfo;
1313 };
1314 
1315 
1316 /* "View.MemoryView":960
1317  *
1318  * @cname('__pyx_memoryviewslice')
1319  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1320  * "Internal class for passing memoryview slices to Python"
1321  *
1322  */
1323 struct __pyx_memoryviewslice_obj {
1324  struct __pyx_memoryview_obj __pyx_base;
1325  __Pyx_memviewslice from_slice;
1326  PyObject *from_object;
1327  PyObject *(*to_object_func)(char *);
1328  int (*to_dtype_func)(char *, PyObject *);
1329 };
1330 
1331 
1332 
1333 /* "BoundaryConditions.py":57
1334  *
1335  *
1336  * class BoundaryCondition: # <<<<<<<<<<<<<<
1337  * """
1338  * Boundary condition class
1339  */
1340 
1341 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition {
1342  void (*resetBC)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, int __pyx_skip_dispatch);
1343 };
1344 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
1345 
1346 
1347 /* "View.MemoryView":104
1348  *
1349  * @cname("__pyx_array")
1350  * cdef class array: # <<<<<<<<<<<<<<
1351  *
1352  * cdef:
1353  */
1354 
1355 struct __pyx_vtabstruct_array {
1356  PyObject *(*get_memview)(struct __pyx_array_obj *);
1357 };
1358 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1359 
1360 
1361 /* "View.MemoryView":329
1362  *
1363  * @cname('__pyx_memoryview')
1364  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1365  *
1366  * cdef object obj
1367  */
1368 
1369 struct __pyx_vtabstruct_memoryview {
1370  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1371  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1372  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1373  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1374  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1375  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1376  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1377 };
1378 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1379 
1380 
1381 /* "View.MemoryView":960
1382  *
1383  * @cname('__pyx_memoryviewslice')
1384  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1385  * "Internal class for passing memoryview slices to Python"
1386  *
1387  */
1388 
1389 struct __pyx_vtabstruct__memoryviewslice {
1390  struct __pyx_vtabstruct_memoryview __pyx_base;
1391 };
1392 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1393 
1394 /* --- Runtime support code (head) --- */
1395 /* Refnanny.proto */
1396 #ifndef CYTHON_REFNANNY
1397  #define CYTHON_REFNANNY 0
1398 #endif
1399 #if CYTHON_REFNANNY
1400  typedef struct {
1401  void (*INCREF)(void*, PyObject*, int);
1402  void (*DECREF)(void*, PyObject*, int);
1403  void (*GOTREF)(void*, PyObject*, int);
1404  void (*GIVEREF)(void*, PyObject*, int);
1405  void* (*SetupContext)(const char*, int, const char*);
1406  void (*FinishContext)(void**);
1407  } __Pyx_RefNannyAPIStruct;
1408  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1409  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1410  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1411 #ifdef WITH_THREAD
1412  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1413  if (acquire_gil) {\
1414  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1415  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1416  PyGILState_Release(__pyx_gilstate_save);\
1417  } else {\
1418  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1419  }
1420 #else
1421  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1422  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1423 #endif
1424  #define __Pyx_RefNannyFinishContext()\
1425  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1426  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1427  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1428  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1429  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1430  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1431  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1432  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1433  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1434 #else
1435  #define __Pyx_RefNannyDeclarations
1436  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1437  #define __Pyx_RefNannyFinishContext()
1438  #define __Pyx_INCREF(r) Py_INCREF(r)
1439  #define __Pyx_DECREF(r) Py_DECREF(r)
1440  #define __Pyx_GOTREF(r)
1441  #define __Pyx_GIVEREF(r)
1442  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1443  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1444  #define __Pyx_XGOTREF(r)
1445  #define __Pyx_XGIVEREF(r)
1446 #endif
1447 #define __Pyx_XDECREF_SET(r, v) do {\
1448  PyObject *tmp = (PyObject *) r;\
1449  r = v; __Pyx_XDECREF(tmp);\
1450  } while (0)
1451 #define __Pyx_DECREF_SET(r, v) do {\
1452  PyObject *tmp = (PyObject *) r;\
1453  r = v; __Pyx_DECREF(tmp);\
1454  } while (0)
1455 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1456 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1457 
1458 /* PyObjectGetAttrStr.proto */
1459 #if CYTHON_USE_TYPE_SLOTS
1460 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1461 #else
1462 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1463 #endif
1464 
1465 /* GetBuiltinName.proto */
1466 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1467 
1468 /* RaiseDoubleKeywords.proto */
1469 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1470 
1471 /* ParseKeywords.proto */
1472 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1473  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1474  const char* function_name);
1475 
1476 /* RaiseArgTupleInvalid.proto */
1477 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1478  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1479 
1480 /* GetItemInt.proto */
1481 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1482  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1483  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1484  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1485  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1486 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1487  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1488  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1489  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1490 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1491  int wraparound, int boundscheck);
1492 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1493  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1494  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1495  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1496 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1497  int wraparound, int boundscheck);
1498 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1499 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1500  int is_list, int wraparound, int boundscheck);
1501 
1502 /* ObjectGetItem.proto */
1503 #if CYTHON_USE_TYPE_SLOTS
1504 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1505 #else
1506 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1507 #endif
1508 
1509 /* MemviewSliceInit.proto */
1510 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1511 #define __Pyx_MEMVIEW_DIRECT 1
1512 #define __Pyx_MEMVIEW_PTR 2
1513 #define __Pyx_MEMVIEW_FULL 4
1514 #define __Pyx_MEMVIEW_CONTIG 8
1515 #define __Pyx_MEMVIEW_STRIDED 16
1516 #define __Pyx_MEMVIEW_FOLLOW 32
1517 #define __Pyx_IS_C_CONTIG 1
1518 #define __Pyx_IS_F_CONTIG 2
1519 static int __Pyx_init_memviewslice(
1520  struct __pyx_memoryview_obj *memview,
1521  int ndim,
1522  __Pyx_memviewslice *memviewslice,
1523  int memview_is_new_reference);
1524 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1525  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1526 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1527  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1528 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1529 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1530 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1531 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1532 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1533 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1534 
1535 /* Import.proto */
1536 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1537 
1538 /* ImportFrom.proto */
1539 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1540 
1541 /* PyCFunctionFastCall.proto */
1542 #if CYTHON_FAST_PYCCALL
1543 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1544 #else
1545 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1546 #endif
1547 
1548 /* PyFunctionFastCall.proto */
1549 #if CYTHON_FAST_PYCALL
1550 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1551  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1552 #if 1 || PY_VERSION_HEX < 0x030600B1
1553 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
1554 #else
1555 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1556 #endif
1557 #endif
1558 
1559 /* PyObjectCall.proto */
1560 #if CYTHON_COMPILING_IN_CPYTHON
1561 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1562 #else
1563 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1564 #endif
1565 
1566 /* PyObjectCallMethO.proto */
1567 #if CYTHON_COMPILING_IN_CPYTHON
1568 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1569 #endif
1570 
1571 /* PyObjectCallOneArg.proto */
1572 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1573 
1574 /* PyObjectCallNoArg.proto */
1575 #if CYTHON_COMPILING_IN_CPYTHON
1576 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1577 #else
1578 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1579 #endif
1580 
1581 /* PyErrExceptionMatches.proto */
1582 #if CYTHON_FAST_THREAD_STATE
1583 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1584 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1585 #else
1586 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1587 #endif
1588 
1589 /* PyThreadStateGet.proto */
1590 #if CYTHON_FAST_THREAD_STATE
1591 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1592 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1593 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1594 #else
1595 #define __Pyx_PyThreadState_declare
1596 #define __Pyx_PyThreadState_assign
1597 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1598 #endif
1599 
1600 /* PyErrFetchRestore.proto */
1601 #if CYTHON_FAST_THREAD_STATE
1602 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1603 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1604 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1605 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1606 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1607 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1608 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1609 #if CYTHON_COMPILING_IN_CPYTHON
1610 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1611 #else
1612 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1613 #endif
1614 #else
1615 #define __Pyx_PyErr_Clear() PyErr_Clear()
1616 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1617 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1618 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1619 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1620 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1621 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1622 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1623 #endif
1624 
1625 /* GetAttr.proto */
1626 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1627 
1628 /* GetAttr3.proto */
1629 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1630 
1631 /* GetModuleGlobalName.proto */
1632 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1633 
1634 /* KeywordStringCheck.proto */
1635 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
1636 
1637 /* WriteUnraisableException.proto */
1638 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1639  int lineno, const char *filename,
1640  int full_traceback, int nogil);
1641 
1642 /* None.proto */
1643 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
1644 
1645 /* FetchCommonType.proto */
1646 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1647 
1648 /* CythonFunction.proto */
1649 #define __Pyx_CyFunction_USED 1
1650 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1651 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1652 #define __Pyx_CYFUNCTION_CCLASS 0x04
1653 #define __Pyx_CyFunction_GetClosure(f)\
1654  (((__pyx_CyFunctionObject *) (f))->func_closure)
1655 #define __Pyx_CyFunction_GetClassObj(f)\
1656  (((__pyx_CyFunctionObject *) (f))->func_classobj)
1657 #define __Pyx_CyFunction_Defaults(type, f)\
1658  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1659 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1660  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1661 typedef struct {
1662  PyCFunctionObject func;
1663 #if PY_VERSION_HEX < 0x030500A0
1664  PyObject *func_weakreflist;
1665 #endif
1666  PyObject *func_dict;
1667  PyObject *func_name;
1668  PyObject *func_qualname;
1669  PyObject *func_doc;
1670  PyObject *func_globals;
1671  PyObject *func_code;
1672  PyObject *func_closure;
1673  PyObject *func_classobj;
1674  void *defaults;
1675  int defaults_pyobjects;
1676  int flags;
1677  PyObject *defaults_tuple;
1678  PyObject *defaults_kwdict;
1679  PyObject *(*defaults_getter)(PyObject *);
1680  PyObject *func_annotations;
1681 } __pyx_CyFunctionObject;
1682 static PyTypeObject *__pyx_CyFunctionType = 0;
1683 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
1684  __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
1685 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
1686  int flags, PyObject* qualname,
1687  PyObject *self,
1688  PyObject *module, PyObject *globals,
1689  PyObject* code);
1690 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1691  size_t size,
1692  int pyobjects);
1693 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1694  PyObject *tuple);
1695 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1696  PyObject *dict);
1697 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1698  PyObject *dict);
1699 static int __pyx_CyFunction_init(void);
1700 
1701 /* SliceObject.proto */
1702 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1703  PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1704  PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1705  int has_cstart, int has_cstop, int wraparound);
1706 
1707 /* RaiseException.proto */
1708 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1709 
1710 /* HasAttr.proto */
1711 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1712 
1713 /* DictGetItem.proto */
1714 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1715 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1716 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1717  (likely(PyDict_CheckExact(obj)) ?\
1718  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1719 #else
1720 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1721 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1722 #endif
1723 
1724 /* RaiseTooManyValuesToUnpack.proto */
1725 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1726 
1727 /* RaiseNeedMoreValuesToUnpack.proto */
1728 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1729 
1730 /* RaiseNoneIterError.proto */
1731 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1732 
1733 /* ExtTypeTest.proto */
1734 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1735 
1736 /* SaveResetException.proto */
1737 #if CYTHON_FAST_THREAD_STATE
1738 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1739 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1740 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1741 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1742 #else
1743 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1744 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1745 #endif
1746 
1747 /* GetException.proto */
1748 #if CYTHON_FAST_THREAD_STATE
1749 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1750 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1751 #else
1752 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1753 #endif
1754 
1755 /* ArgTypeTest.proto */
1756 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1757  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1758  __Pyx__ArgTypeTest(obj, type, name, exact))
1759 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1760 
1761 /* IncludeStringH.proto */
1762 #include <string.h>
1763 
1764 /* BytesEquals.proto */
1765 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1766 
1767 /* UnicodeEquals.proto */
1768 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1769 
1770 /* StrEquals.proto */
1771 #if PY_MAJOR_VERSION >= 3
1772 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1773 #else
1774 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1775 #endif
1776 
1777 /* None.proto */
1778 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1779 
1780 /* UnaryNegOverflows.proto */
1781 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1782  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1783 
1784 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1785 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1786 /* decode_c_string_utf16.proto */
1787 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1788  int byteorder = 0;
1789  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1790 }
1791 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1792  int byteorder = -1;
1793  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1794 }
1795 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1796  int byteorder = 1;
1797  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1798 }
1799 
1800 /* decode_c_string.proto */
1801 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1802  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1803  const char* encoding, const char* errors,
1804  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1805 
1806 /* SwapException.proto */
1807 #if CYTHON_FAST_THREAD_STATE
1808 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1809 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1810 #else
1811 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1812 #endif
1813 
1814 /* FastTypeChecks.proto */
1815 #if CYTHON_COMPILING_IN_CPYTHON
1816 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1817 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1818 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1819 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1820 #else
1821 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1822 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1823 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1824 #endif
1825 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1826 
1827 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1828 /* ListCompAppend.proto */
1829 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1830 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1831  PyListObject* L = (PyListObject*) list;
1832  Py_ssize_t len = Py_SIZE(list);
1833  if (likely(L->allocated > len)) {
1834  Py_INCREF(x);
1835  PyList_SET_ITEM(list, len, x);
1836  Py_SIZE(list) = len+1;
1837  return 0;
1838  }
1839  return PyList_Append(list, x);
1840 }
1841 #else
1842 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1843 #endif
1844 
1845 /* PyIntBinop.proto */
1846 #if !CYTHON_COMPILING_IN_PYPY
1847 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
1848 #else
1849 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
1850  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1851 #endif
1852 
1853 /* ListExtend.proto */
1854 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1855 #if CYTHON_COMPILING_IN_CPYTHON
1856  PyObject* none = _PyList_Extend((PyListObject*)L, v);
1857  if (unlikely(!none))
1858  return -1;
1859  Py_DECREF(none);
1860  return 0;
1861 #else
1862  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1863 #endif
1864 }
1865 
1866 /* ListAppend.proto */
1867 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1868 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1869  PyListObject* L = (PyListObject*) list;
1870  Py_ssize_t len = Py_SIZE(list);
1871  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1872  Py_INCREF(x);
1873  PyList_SET_ITEM(list, len, x);
1874  Py_SIZE(list) = len+1;
1875  return 0;
1876  }
1877  return PyList_Append(list, x);
1878 }
1879 #else
1880 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1881 #endif
1882 
1883 /* None.proto */
1884 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1885 
1886 /* None.proto */
1887 static CYTHON_INLINE long __Pyx_div_long(long, long);
1888 
1889 /* PyObject_GenericGetAttrNoDict.proto */
1890 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1891 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1892 #else
1893 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1894 #endif
1895 
1896 /* PyObject_GenericGetAttr.proto */
1897 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1898 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1899 #else
1900 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1901 #endif
1902 
1903 /* SetupReduce.proto */
1904 static int __Pyx_setup_reduce(PyObject* type_obj);
1905 
1906 /* SetVTable.proto */
1907 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1908 
1909 /* CLineInTraceback.proto */
1910 #ifdef CYTHON_CLINE_IN_TRACEBACK
1911 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1912 #else
1913 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1914 #endif
1915 
1916 /* CodeObjectCache.proto */
1917 typedef struct {
1918  PyCodeObject* code_object;
1919  int code_line;
1920 } __Pyx_CodeObjectCacheEntry;
1921 struct __Pyx_CodeObjectCache {
1922  int count;
1923  int max_count;
1924  __Pyx_CodeObjectCacheEntry* entries;
1925 };
1926 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1927 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1928 static PyCodeObject *__pyx_find_code_object(int code_line);
1929 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1930 
1931 /* AddTraceback.proto */
1932 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1933  int py_line, const char *filename);
1934 
1935 #if PY_MAJOR_VERSION < 3
1936  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
1937  static void __Pyx_ReleaseBuffer(Py_buffer *view);
1938 #else
1939  #define __Pyx_GetBuffer PyObject_GetBuffer
1940  #define __Pyx_ReleaseBuffer PyBuffer_Release
1941 #endif
1942 
1943 
1944 /* BufferStructDeclare.proto */
1945 typedef struct {
1946  Py_ssize_t shape, strides, suboffsets;
1947 } __Pyx_Buf_DimInfo;
1948 typedef struct {
1949  size_t refcount;
1950  Py_buffer pybuffer;
1951 } __Pyx_Buffer;
1952 typedef struct {
1953  __Pyx_Buffer *rcbuffer;
1954  char *data;
1955  __Pyx_Buf_DimInfo diminfo[8];
1956 } __Pyx_LocalBuf_ND;
1957 
1958 /* MemviewSliceIsContig.proto */
1959 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
1960 
1961 /* OverlappingSlices.proto */
1962 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
1963  __Pyx_memviewslice *slice2,
1964  int ndim, size_t itemsize);
1965 
1966 /* Capsule.proto */
1967 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
1968 
1969 /* MemviewDtypeToObject.proto */
1970 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
1971 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
1972 
1973 /* IsLittleEndian.proto */
1974 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
1975 
1976 /* BufferFormatCheck.proto */
1977 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
1978 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1979  __Pyx_BufFmt_StackElem* stack,
1980  __Pyx_TypeInfo* type);
1981 
1982 /* TypeInfoCompare.proto */
1983 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
1984 
1985 /* MemviewSliceValidateAndInit.proto */
1986 static int __Pyx_ValidateAndInit_memviewslice(
1987  int *axes_specs,
1988  int c_or_f_flag,
1989  int buf_flags,
1990  int ndim,
1991  __Pyx_TypeInfo *dtype,
1992  __Pyx_BufFmt_StackElem stack[],
1993  __Pyx_memviewslice *memviewslice,
1994  PyObject *original_obj);
1995 
1996 /* ObjectToMemviewSlice.proto */
1997 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
1998 
1999 /* CIntToPy.proto */
2000 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2001 
2002 /* CIntToPy.proto */
2003 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2004 
2005 /* RealImag.proto */
2006 #if CYTHON_CCOMPLEX
2007  #ifdef __cplusplus
2008  #define __Pyx_CREAL(z) ((z).real())
2009  #define __Pyx_CIMAG(z) ((z).imag())
2010  #else
2011  #define __Pyx_CREAL(z) (__real__(z))
2012  #define __Pyx_CIMAG(z) (__imag__(z))
2013  #endif
2014 #else
2015  #define __Pyx_CREAL(z) ((z).real)
2016  #define __Pyx_CIMAG(z) ((z).imag)
2017 #endif
2018 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2019  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2020  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2021  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2022 #else
2023  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2024  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2025 #endif
2026 
2027 /* Arithmetic.proto */
2028 #if CYTHON_CCOMPLEX
2029  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2030  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2031  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2032  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2033  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2034  #define __Pyx_c_neg_float(a) (-(a))
2035  #ifdef __cplusplus
2036  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2037  #define __Pyx_c_conj_float(z) (::std::conj(z))
2038  #if 1
2039  #define __Pyx_c_abs_float(z) (::std::abs(z))
2040  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2041  #endif
2042  #else
2043  #define __Pyx_c_is_zero_float(z) ((z)==0)
2044  #define __Pyx_c_conj_float(z) (conjf(z))
2045  #if 1
2046  #define __Pyx_c_abs_float(z) (cabsf(z))
2047  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2048  #endif
2049  #endif
2050 #else
2051  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2052  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2053  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2054  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2055  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2056  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2057  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2058  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2059  #if 1
2060  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2061  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2062  #endif
2063 #endif
2064 
2065 /* Arithmetic.proto */
2066 #if CYTHON_CCOMPLEX
2067  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2068  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2069  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2070  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2071  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2072  #define __Pyx_c_neg_double(a) (-(a))
2073  #ifdef __cplusplus
2074  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2075  #define __Pyx_c_conj_double(z) (::std::conj(z))
2076  #if 1
2077  #define __Pyx_c_abs_double(z) (::std::abs(z))
2078  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2079  #endif
2080  #else
2081  #define __Pyx_c_is_zero_double(z) ((z)==0)
2082  #define __Pyx_c_conj_double(z) (conj(z))
2083  #if 1
2084  #define __Pyx_c_abs_double(z) (cabs(z))
2085  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2086  #endif
2087  #endif
2088 #else
2089  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2090  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2091  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2092  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2093  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2094  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2095  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2096  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2097  #if 1
2098  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2099  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2100  #endif
2101 #endif
2102 
2103 /* CIntToPy.proto */
2104 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2105 
2106 /* MemviewSliceCopyTemplate.proto */
2107 static __Pyx_memviewslice
2108 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2109  const char *mode, int ndim,
2110  size_t sizeof_dtype, int contig_flag,
2111  int dtype_is_object);
2112 
2113 /* CIntFromPy.proto */
2114 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2115 
2116 /* CIntFromPy.proto */
2117 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2118 
2119 /* CIntFromPy.proto */
2120 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2121 
2122 /* CheckBinaryVersion.proto */
2123 static int __Pyx_check_binary_version(void);
2124 
2125 /* PyIdentifierFromString.proto */
2126 #if !defined(__Pyx_PyIdentifier_FromString)
2127 #if PY_MAJOR_VERSION < 3
2128  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
2129 #else
2130  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
2131 #endif
2132 #endif
2133 
2134 /* ModuleImport.proto */
2135 static PyObject *__Pyx_ImportModule(const char *name);
2136 
2137 /* TypeImport.proto */
2138 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
2139 
2140 /* InitStrings.proto */
2141 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2142 
2143 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2144 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2145 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2146 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2147 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2148 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2149 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2150 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2151 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2152 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2153 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2154 
2155 /* Module declarations from 'cython.view' */
2156 
2157 /* Module declarations from 'cython' */
2158 
2159 /* Module declarations from 'cpython.buffer' */
2160 
2161 /* Module declarations from 'libc.string' */
2162 
2163 /* Module declarations from 'libc.stdio' */
2164 
2165 /* Module declarations from '__builtin__' */
2166 
2167 /* Module declarations from 'cpython.type' */
2168 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2169 
2170 /* Module declarations from 'cpython' */
2171 
2172 /* Module declarations from 'cpython.object' */
2173 
2174 /* Module declarations from 'cpython.ref' */
2175 
2176 /* Module declarations from 'cpython.mem' */
2177 
2178 /* Module declarations from 'numpy' */
2179 
2180 /* Module declarations from 'numpy' */
2181 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2182 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2183 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2184 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2185 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2186 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2187 
2188 /* Module declarations from 'BoundaryConditions' */
2189 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BC_Base = 0;
2190 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BoundaryCondition = 0;
2191 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
2192 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
2193 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
2194 static PyTypeObject *__pyx_array_type = 0;
2195 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2196 static PyTypeObject *__pyx_memoryview_type = 0;
2197 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2198 static PyObject *generic = 0;
2199 static PyObject *strided = 0;
2200 static PyObject *indirect = 0;
2201 static PyObject *contiguous = 0;
2202 static PyObject *indirect_contiguous = 0;
2203 static int __pyx_memoryview_thread_locks_used;
2204 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2205 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(struct __pyx_obj_18BoundaryConditions_BC_Base *, PyObject *); /*proto*/
2206 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2207 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2208 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2209 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2210 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2211 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2212 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2213 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2214 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2215 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2216 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2217 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2218 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2219 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2220 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2221 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2222 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2223 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2224 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2225 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2226 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2227 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2228 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2229 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2230 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2231 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2232 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2233 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2234 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2235 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2236 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2237 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2238 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2239 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2240 #define __Pyx_MODULE_NAME "BoundaryConditions"
2241 extern int __pyx_module_is_main_BoundaryConditions;
2242 int __pyx_module_is_main_BoundaryConditions = 0;
2243 
2244 /* Implementation of 'BoundaryConditions' */
2245 static PyObject *__pyx_builtin_sum;
2246 static PyObject *__pyx_builtin_TypeError;
2247 static PyObject *__pyx_builtin_ValueError;
2248 static PyObject *__pyx_builtin_range;
2249 static PyObject *__pyx_builtin_RuntimeError;
2250 static PyObject *__pyx_builtin_ImportError;
2251 static PyObject *__pyx_builtin_MemoryError;
2252 static PyObject *__pyx_builtin_enumerate;
2253 static PyObject *__pyx_builtin_Ellipsis;
2254 static PyObject *__pyx_builtin_id;
2255 static PyObject *__pyx_builtin_IndexError;
2256 static const char __pyx_k_O[] = "O";
2257 static const char __pyx_k_a[] = "a";
2258 static const char __pyx_k_c[] = "c";
2259 static const char __pyx_k_t[] = "t";
2260 static const char __pyx_k_x[] = "x";
2261 static const char __pyx_k_a0[] = "a0";
2262 static const char __pyx_k_id[] = "id";
2263 static const char __pyx_k_nd[] = "nd";
2264 static const char __pyx_k_t1[] = "t1";
2265 static const char __pyx_k_b_i[] = "b_i";
2266 static const char __pyx_k_get[] = "get";
2267 static const char __pyx_k_new[] = "__new__";
2268 static const char __pyx_k_obj[] = "obj";
2269 static const char __pyx_k_sum[] = "sum";
2270 static const char __pyx_k_None[] = "None";
2271 static const char __pyx_k_b_or[] = "b_or";
2272 static const char __pyx_k_base[] = "base";
2273 static const char __pyx_k_dict[] = "__dict__";
2274 static const char __pyx_k_main[] = "__main__";
2275 static const char __pyx_k_mode[] = "mode";
2276 static const char __pyx_k_name[] = "name";
2277 static const char __pyx_k_ndim[] = "ndim";
2278 static const char __pyx_k_pack[] = "pack";
2279 static const char __pyx_k_self[] = "self";
2280 static const char __pyx_k_size[] = "size";
2281 static const char __pyx_k_step[] = "step";
2282 static const char __pyx_k_stop[] = "stop";
2283 static const char __pyx_k_test[] = "__test__";
2284 static const char __pyx_k_ASCII[] = "ASCII";
2285 static const char __pyx_k_class[] = "__class__";
2286 static const char __pyx_k_error[] = "error";
2287 static const char __pyx_k_flags[] = "flags";
2288 static const char __pyx_k_range[] = "range";
2289 static const char __pyx_k_shape[] = "shape";
2290 static const char __pyx_k_start[] = "start";
2291 static const char __pyx_k_state[] = "state";
2292 static const char __pyx_k_value[] = "value";
2293 static const char __pyx_k_Domain[] = "Domain";
2294 static const char __pyx_k_dict_2[] = "_dict";
2295 static const char __pyx_k_encode[] = "encode";
2296 static const char __pyx_k_format[] = "format";
2297 static const char __pyx_k_import[] = "__import__";
2298 static const char __pyx_k_name_2[] = "__name__";
2299 static const char __pyx_k_pickle[] = "pickle";
2300 static const char __pyx_k_reduce[] = "__reduce__";
2301 static const char __pyx_k_struct[] = "struct";
2302 static const char __pyx_k_unpack[] = "unpack";
2303 static const char __pyx_k_update[] = "update";
2304 static const char __pyx_k_Context[] = "Context";
2305 static const char __pyx_k_context[] = "context";
2306 static const char __pyx_k_fortran[] = "fortran";
2307 static const char __pyx_k_memview[] = "memview";
2308 static const char __pyx_k_proteus[] = "proteus";
2309 static const char __pyx_k_resetBC[] = "resetBC";
2310 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2311 static const char __pyx_k_getstate[] = "__getstate__";
2312 static const char __pyx_k_itemsize[] = "itemsize";
2313 static const char __pyx_k_pyx_type[] = "__pyx_type";
2314 static const char __pyx_k_setstate[] = "__setstate__";
2315 static const char __pyx_k_TypeError[] = "TypeError";
2316 static const char __pyx_k_enumerate[] = "enumerate";
2317 static const char __pyx_k_pyx_state[] = "__pyx_state";
2318 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2319 static const char __pyx_k_IndexError[] = "IndexError";
2320 static const char __pyx_k_ValueError[] = "ValueError";
2321 static const char __pyx_k_getContext[] = "getContext";
2322 static const char __pyx_k_pyx_result[] = "__pyx_result";
2323 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2324 static const char __pyx_k_ImportError[] = "ImportError";
2325 static const char __pyx_k_MemoryError[] = "MemoryError";
2326 static const char __pyx_k_PickleError[] = "PickleError";
2327 static const char __pyx_k_init_cython[] = "init_cython";
2328 static const char __pyx_k_setLinearBC[] = "setLinearBC";
2329 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2330 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2331 static const char __pyx_k_stringsource[] = "stringsource";
2332 static const char __pyx_k_use_setstate[] = "use_setstate";
2333 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2334 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2335 static const char __pyx_k_setConstantBC[] = "setConstantBC";
2336 static const char __pyx_k_setLinearRamp[] = "setLinearRamp";
2337 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2338 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2339 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2340 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2341 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2342 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2343 static const char __pyx_k_BC_Base_getContext[] = "BC_Base.getContext";
2344 static const char __pyx_k_BoundaryConditions[] = "BoundaryConditions";
2345 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2346 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2347 static const char __pyx_k_pyx_unpickle_BC_Base[] = "__pyx_unpickle_BC_Base";
2348 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2349 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2350 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2351 static const char __pyx_k_BC_Base___reduce_cython[] = "BC_Base.__reduce_cython__";
2352 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2353 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2354 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2355 static const char __pyx_k_BC_Base___setstate_cython[] = "BC_Base.__setstate_cython__";
2356 static const char __pyx_k_BoundaryCondition_resetBC[] = "BoundaryCondition.resetBC";
2357 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2358 static const char __pyx_k_setLinearBC_locals_lambda[] = "setLinearBC.<locals>.<lambda>";
2359 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2360 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
2361 static const char __pyx_k_setConstantBC_locals_lambda[] = "setConstantBC.<locals>.<lambda>";
2362 static const char __pyx_k_setLinearRamp_locals_lambda[] = "setLinearRamp.<locals>.<lambda>";
2363 static const char __pyx_k_BoundaryCondition_init_cython[] = "BoundaryCondition.init_cython";
2364 static const char __pyx_k_BoundaryCondition_setLinearBC[] = "BoundaryCondition.setLinearBC";
2365 static const char __pyx_k_proteus_BoundaryConditions_py[] = "proteus/BoundaryConditions.py";
2366 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2367 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2368 static const char __pyx_k_BoundaryCondition_setConstantBC[] = "BoundaryCondition.setConstantBC";
2369 static const char __pyx_k_BoundaryCondition_setLinearRamp[] = "BoundaryCondition.setLinearRamp";
2370 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2371 static const char __pyx_k_self_uuOfXT_cannot_be_converted[] = "self.uuOfXT cannot be converted to a Python object for pickling";
2372 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2373 static const char __pyx_k_BoundaryCondition___reduce_cytho[] = "BoundaryCondition.__reduce_cython__";
2374 static const char __pyx_k_BoundaryCondition___setstate_cyt[] = "BoundaryCondition.__setstate_cython__";
2375 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2376 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2377 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2378 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2379 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2380 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2381 static const char __pyx_k_Incompatible_checksums_s_vs_0x96[] = "Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))";
2382 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2383 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2384 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2385 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2386 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2387 static const char __pyx_k_Shape_or_nd_must_be_passed_to_BC[] = "Shape or nd must be passed to BC";
2388 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2389 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2390 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
2391 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2392 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2393 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2394 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2395 static PyObject *__pyx_n_s_ASCII;
2396 static PyObject *__pyx_n_s_BC_Base___reduce_cython;
2397 static PyObject *__pyx_n_s_BC_Base___setstate_cython;
2398 static PyObject *__pyx_n_s_BC_Base_getContext;
2399 static PyObject *__pyx_n_s_BoundaryCondition___reduce_cytho;
2400 static PyObject *__pyx_n_s_BoundaryCondition___setstate_cyt;
2401 static PyObject *__pyx_n_s_BoundaryCondition_init_cython;
2402 static PyObject *__pyx_n_s_BoundaryCondition_resetBC;
2403 static PyObject *__pyx_n_s_BoundaryCondition_setConstantBC;
2404 static PyObject *__pyx_n_s_BoundaryCondition_setLinearBC;
2405 static PyObject *__pyx_n_s_BoundaryCondition_setLinearRamp;
2406 static PyObject *__pyx_n_s_BoundaryConditions;
2407 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2408 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2409 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2410 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2411 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2412 static PyObject *__pyx_n_s_Context;
2413 static PyObject *__pyx_n_s_Domain;
2414 static PyObject *__pyx_n_s_Ellipsis;
2415 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2416 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2417 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2418 static PyObject *__pyx_n_s_ImportError;
2419 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x96;
2420 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2421 static PyObject *__pyx_n_s_IndexError;
2422 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2423 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2424 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2425 static PyObject *__pyx_n_s_MemoryError;
2426 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2427 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2428 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2429 static PyObject *__pyx_n_s_None;
2430 static PyObject *__pyx_n_b_O;
2431 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2432 static PyObject *__pyx_n_s_PickleError;
2433 static PyObject *__pyx_n_s_RuntimeError;
2434 static PyObject *__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC;
2435 static PyObject *__pyx_n_s_TypeError;
2436 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2437 static PyObject *__pyx_n_s_ValueError;
2438 static PyObject *__pyx_n_s_View_MemoryView;
2439 static PyObject *__pyx_n_s_a;
2440 static PyObject *__pyx_n_s_a0;
2441 static PyObject *__pyx_n_s_allocate_buffer;
2442 static PyObject *__pyx_n_s_b_i;
2443 static PyObject *__pyx_n_s_b_or;
2444 static PyObject *__pyx_n_s_base;
2445 static PyObject *__pyx_n_s_c;
2446 static PyObject *__pyx_n_u_c;
2447 static PyObject *__pyx_n_s_class;
2448 static PyObject *__pyx_n_s_cline_in_traceback;
2449 static PyObject *__pyx_n_s_context;
2450 static PyObject *__pyx_kp_s_contiguous_and_direct;
2451 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2452 static PyObject *__pyx_n_s_dict;
2453 static PyObject *__pyx_n_s_dict_2;
2454 static PyObject *__pyx_n_s_dtype_is_object;
2455 static PyObject *__pyx_n_s_encode;
2456 static PyObject *__pyx_n_s_enumerate;
2457 static PyObject *__pyx_n_s_error;
2458 static PyObject *__pyx_n_s_flags;
2459 static PyObject *__pyx_n_s_format;
2460 static PyObject *__pyx_n_s_fortran;
2461 static PyObject *__pyx_n_u_fortran;
2462 static PyObject *__pyx_n_s_get;
2463 static PyObject *__pyx_n_s_getContext;
2464 static PyObject *__pyx_n_s_getstate;
2465 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2466 static PyObject *__pyx_n_s_id;
2467 static PyObject *__pyx_n_s_import;
2468 static PyObject *__pyx_n_s_init_cython;
2469 static PyObject *__pyx_n_s_itemsize;
2470 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2471 static PyObject *__pyx_n_s_main;
2472 static PyObject *__pyx_n_s_memview;
2473 static PyObject *__pyx_n_s_mode;
2474 static PyObject *__pyx_n_s_name;
2475 static PyObject *__pyx_n_s_name_2;
2476 static PyObject *__pyx_n_s_nd;
2477 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2478 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2479 static PyObject *__pyx_n_s_ndim;
2480 static PyObject *__pyx_n_s_new;
2481 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2482 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2483 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2484 static PyObject *__pyx_n_s_obj;
2485 static PyObject *__pyx_n_s_pack;
2486 static PyObject *__pyx_n_s_pickle;
2487 static PyObject *__pyx_n_s_proteus;
2488 static PyObject *__pyx_kp_s_proteus_BoundaryConditions_py;
2489 static PyObject *__pyx_n_s_pyx_PickleError;
2490 static PyObject *__pyx_n_s_pyx_checksum;
2491 static PyObject *__pyx_n_s_pyx_getbuffer;
2492 static PyObject *__pyx_n_s_pyx_result;
2493 static PyObject *__pyx_n_s_pyx_state;
2494 static PyObject *__pyx_n_s_pyx_type;
2495 static PyObject *__pyx_n_s_pyx_unpickle_BC_Base;
2496 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2497 static PyObject *__pyx_n_s_pyx_vtable;
2498 static PyObject *__pyx_n_s_range;
2499 static PyObject *__pyx_n_s_reduce;
2500 static PyObject *__pyx_n_s_reduce_cython;
2501 static PyObject *__pyx_n_s_reduce_ex;
2502 static PyObject *__pyx_n_s_resetBC;
2503 static PyObject *__pyx_n_s_self;
2504 static PyObject *__pyx_kp_s_self_uuOfXT_cannot_be_converted;
2505 static PyObject *__pyx_n_s_setConstantBC;
2506 static PyObject *__pyx_n_s_setConstantBC_locals_lambda;
2507 static PyObject *__pyx_n_s_setLinearBC;
2508 static PyObject *__pyx_n_s_setLinearBC_locals_lambda;
2509 static PyObject *__pyx_n_s_setLinearRamp;
2510 static PyObject *__pyx_n_s_setLinearRamp_locals_lambda;
2511 static PyObject *__pyx_n_s_setstate;
2512 static PyObject *__pyx_n_s_setstate_cython;
2513 static PyObject *__pyx_n_s_shape;
2514 static PyObject *__pyx_n_s_size;
2515 static PyObject *__pyx_n_s_start;
2516 static PyObject *__pyx_n_s_state;
2517 static PyObject *__pyx_n_s_step;
2518 static PyObject *__pyx_n_s_stop;
2519 static PyObject *__pyx_kp_s_strided_and_direct;
2520 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2521 static PyObject *__pyx_kp_s_strided_and_indirect;
2522 static PyObject *__pyx_kp_s_stringsource;
2523 static PyObject *__pyx_n_s_struct;
2524 static PyObject *__pyx_n_s_sum;
2525 static PyObject *__pyx_n_s_t;
2526 static PyObject *__pyx_n_s_t1;
2527 static PyObject *__pyx_n_s_test;
2528 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2529 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2530 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2531 static PyObject *__pyx_n_s_unpack;
2532 static PyObject *__pyx_n_s_update;
2533 static PyObject *__pyx_n_s_use_setstate;
2534 static PyObject *__pyx_n_s_value;
2535 static PyObject *__pyx_n_s_x;
2536 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd); /* proto */
2537 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
2538 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2539 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2540 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2541 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2542 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2543 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2544 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2545 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2546 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2547 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2548 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2549 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2550 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2551 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2552 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2553 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2554 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2555 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2556 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2557 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t); /* proto */
2558 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2559 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t); /* proto */
2560 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a); /* proto */
2561 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
2562 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value); /* proto */
2563 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2564 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2565 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2566 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2567 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2568 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2569 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2570 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
2571 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2572 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2573 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2574 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2575 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2576 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2577 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2578 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2579 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2580 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2581 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2582 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2583 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2584 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2585 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2586 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2587 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2588 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2589 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2590 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2591 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2592 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2593 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2594 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2595 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2596 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2597 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2598 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2599 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2600 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2601 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2602 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2603 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2604 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2605 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2606 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2607 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2608 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2609 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2610 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2611 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2612 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2613 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2614 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2615 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2616 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2617 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2618 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2619 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2620 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2621 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2622 static PyObject *__pyx_int_0;
2623 static PyObject *__pyx_int_1;
2624 static PyObject *__pyx_int_158231071;
2625 static PyObject *__pyx_int_184977713;
2626 static PyObject *__pyx_int_neg_1;
2627 static PyObject *__pyx_slice_;
2628 static PyObject *__pyx_slice__2;
2629 static PyObject *__pyx_tuple__3;
2630 static PyObject *__pyx_tuple__4;
2631 static PyObject *__pyx_tuple__5;
2632 static PyObject *__pyx_tuple__6;
2633 static PyObject *__pyx_tuple__7;
2634 static PyObject *__pyx_tuple__8;
2635 static PyObject *__pyx_tuple__9;
2636 static PyObject *__pyx_slice__29;
2637 static PyObject *__pyx_slice__30;
2638 static PyObject *__pyx_slice__31;
2639 static PyObject *__pyx_tuple__10;
2640 static PyObject *__pyx_tuple__11;
2641 static PyObject *__pyx_tuple__12;
2642 static PyObject *__pyx_tuple__13;
2643 static PyObject *__pyx_tuple__14;
2644 static PyObject *__pyx_tuple__15;
2645 static PyObject *__pyx_tuple__16;
2646 static PyObject *__pyx_tuple__17;
2647 static PyObject *__pyx_tuple__18;
2648 static PyObject *__pyx_tuple__19;
2649 static PyObject *__pyx_tuple__20;
2650 static PyObject *__pyx_tuple__21;
2651 static PyObject *__pyx_tuple__22;
2652 static PyObject *__pyx_tuple__23;
2653 static PyObject *__pyx_tuple__24;
2654 static PyObject *__pyx_tuple__25;
2655 static PyObject *__pyx_tuple__26;
2656 static PyObject *__pyx_tuple__27;
2657 static PyObject *__pyx_tuple__28;
2658 static PyObject *__pyx_tuple__32;
2659 static PyObject *__pyx_tuple__33;
2660 static PyObject *__pyx_tuple__34;
2661 static PyObject *__pyx_tuple__35;
2662 static PyObject *__pyx_tuple__37;
2663 static PyObject *__pyx_tuple__39;
2664 static PyObject *__pyx_tuple__41;
2665 static PyObject *__pyx_tuple__43;
2666 static PyObject *__pyx_tuple__45;
2667 static PyObject *__pyx_tuple__47;
2668 static PyObject *__pyx_tuple__49;
2669 static PyObject *__pyx_tuple__51;
2670 static PyObject *__pyx_tuple__53;
2671 static PyObject *__pyx_tuple__55;
2672 static PyObject *__pyx_tuple__57;
2673 static PyObject *__pyx_tuple__58;
2674 static PyObject *__pyx_tuple__59;
2675 static PyObject *__pyx_tuple__60;
2676 static PyObject *__pyx_tuple__61;
2677 static PyObject *__pyx_tuple__62;
2678 static PyObject *__pyx_codeobj__36;
2679 static PyObject *__pyx_codeobj__38;
2680 static PyObject *__pyx_codeobj__40;
2681 static PyObject *__pyx_codeobj__42;
2682 static PyObject *__pyx_codeobj__44;
2683 static PyObject *__pyx_codeobj__46;
2684 static PyObject *__pyx_codeobj__48;
2685 static PyObject *__pyx_codeobj__50;
2686 static PyObject *__pyx_codeobj__52;
2687 static PyObject *__pyx_codeobj__54;
2688 static PyObject *__pyx_codeobj__56;
2689 static PyObject *__pyx_codeobj__63;
2690 /* Late includes */
2691 
2692 /* "BoundaryConditions.py":13
2693  * Generic class regrouping boundary conditions
2694  * """
2695  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None): # <<<<<<<<<<<<<<
2696  * self.Shape = shape
2697  * self.name = name
2698  */
2699 
2700 /* Python wrapper */
2701 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2702 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2703  PyObject *__pyx_v_shape = 0;
2704  PyObject *__pyx_v_name = 0;
2705  PyObject *__pyx_v_b_or = 0;
2706  PyObject *__pyx_v_b_i = 0;
2707  PyObject *__pyx_v_nd = 0;
2708  int __pyx_r;
2709  __Pyx_RefNannyDeclarations
2710  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2711  {
2712  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_name,&__pyx_n_s_b_or,&__pyx_n_s_b_i,&__pyx_n_s_nd,0};
2713  PyObject* values[5] = {0,0,0,0,0};
2714  values[0] = ((PyObject *)Py_None);
2715  values[1] = ((PyObject *)Py_None);
2716  values[2] = ((PyObject *)Py_None);
2717  values[3] = ((PyObject *)__pyx_int_0);
2718  values[4] = ((PyObject *)Py_None);
2719  if (unlikely(__pyx_kwds)) {
2720  Py_ssize_t kw_args;
2721  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2722  switch (pos_args) {
2723  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2724  CYTHON_FALLTHROUGH;
2725  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2726  CYTHON_FALLTHROUGH;
2727  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2728  CYTHON_FALLTHROUGH;
2729  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2730  CYTHON_FALLTHROUGH;
2731  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2732  CYTHON_FALLTHROUGH;
2733  case 0: break;
2734  default: goto __pyx_L5_argtuple_error;
2735  }
2736  kw_args = PyDict_Size(__pyx_kwds);
2737  switch (pos_args) {
2738  case 0:
2739  if (kw_args > 0) {
2740  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape);
2741  if (value) { values[0] = value; kw_args--; }
2742  }
2743  CYTHON_FALLTHROUGH;
2744  case 1:
2745  if (kw_args > 0) {
2746  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
2747  if (value) { values[1] = value; kw_args--; }
2748  }
2749  CYTHON_FALLTHROUGH;
2750  case 2:
2751  if (kw_args > 0) {
2752  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_or);
2753  if (value) { values[2] = value; kw_args--; }
2754  }
2755  CYTHON_FALLTHROUGH;
2756  case 3:
2757  if (kw_args > 0) {
2758  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_i);
2759  if (value) { values[3] = value; kw_args--; }
2760  }
2761  CYTHON_FALLTHROUGH;
2762  case 4:
2763  if (kw_args > 0) {
2764  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd);
2765  if (value) { values[4] = value; kw_args--; }
2766  }
2767  }
2768  if (unlikely(kw_args > 0)) {
2769  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
2770  }
2771  } else {
2772  switch (PyTuple_GET_SIZE(__pyx_args)) {
2773  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2774  CYTHON_FALLTHROUGH;
2775  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2776  CYTHON_FALLTHROUGH;
2777  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2778  CYTHON_FALLTHROUGH;
2779  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2780  CYTHON_FALLTHROUGH;
2781  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2782  CYTHON_FALLTHROUGH;
2783  case 0: break;
2784  default: goto __pyx_L5_argtuple_error;
2785  }
2786  }
2787  __pyx_v_shape = values[0];
2788  __pyx_v_name = values[1];
2789  __pyx_v_b_or = values[2];
2790  __pyx_v_b_i = values[3];
2791  __pyx_v_nd = values[4];
2792  }
2793  goto __pyx_L4_argument_unpacking_done;
2794  __pyx_L5_argtuple_error:;
2795  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
2796  __pyx_L3_error:;
2797  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2798  __Pyx_RefNannyFinishContext();
2799  return -1;
2800  __pyx_L4_argument_unpacking_done:;
2801  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base___init__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_shape, __pyx_v_name, __pyx_v_b_or, __pyx_v_b_i, __pyx_v_nd);
2802 
2803  /* function exit code */
2804  __Pyx_RefNannyFinishContext();
2805  return __pyx_r;
2806 }
2807 
2808 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd) {
2809  int __pyx_r;
2810  __Pyx_RefNannyDeclarations
2811  PyObject *__pyx_t_1 = NULL;
2812  int __pyx_t_2;
2813  int __pyx_t_3;
2814  PyObject *__pyx_t_4 = NULL;
2815  int __pyx_t_5;
2816  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
2817  __Pyx_RefNannySetupContext("__init__", 0);
2818 
2819  /* "BoundaryConditions.py":14
2820  * """
2821  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None):
2822  * self.Shape = shape # <<<<<<<<<<<<<<
2823  * self.name = name
2824  * self.BC_type = 'None'
2825  */
2826  __Pyx_INCREF(__pyx_v_shape);
2827  __Pyx_GIVEREF(__pyx_v_shape);
2828  __Pyx_GOTREF(__pyx_v_self->Shape);
2829  __Pyx_DECREF(__pyx_v_self->Shape);
2830  __pyx_v_self->Shape = __pyx_v_shape;
2831 
2832  /* "BoundaryConditions.py":15
2833  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None):
2834  * self.Shape = shape
2835  * self.name = name # <<<<<<<<<<<<<<
2836  * self.BC_type = 'None'
2837  * if shape is not None:
2838  */
2839  if (!(likely(PyString_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(0, 15, __pyx_L1_error)
2840  __pyx_t_1 = __pyx_v_name;
2841  __Pyx_INCREF(__pyx_t_1);
2842  __Pyx_GIVEREF(__pyx_t_1);
2843  __Pyx_GOTREF(__pyx_v_self->name);
2844  __Pyx_DECREF(__pyx_v_self->name);
2845  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
2846  __pyx_t_1 = 0;
2847 
2848  /* "BoundaryConditions.py":16
2849  * self.Shape = shape
2850  * self.name = name
2851  * self.BC_type = 'None' # <<<<<<<<<<<<<<
2852  * if shape is not None:
2853  * self.nd = self.Shape.Domain.nd
2854  */
2855  __Pyx_INCREF(__pyx_n_s_None);
2856  __Pyx_GIVEREF(__pyx_n_s_None);
2857  __Pyx_GOTREF(__pyx_v_self->BC_type);
2858  __Pyx_DECREF(__pyx_v_self->BC_type);
2859  __pyx_v_self->BC_type = __pyx_n_s_None;
2860 
2861  /* "BoundaryConditions.py":17
2862  * self.name = name
2863  * self.BC_type = 'None'
2864  * if shape is not None: # <<<<<<<<<<<<<<
2865  * self.nd = self.Shape.Domain.nd
2866  * elif nd is not None:
2867  */
2868  __pyx_t_2 = (__pyx_v_shape != Py_None);
2869  __pyx_t_3 = (__pyx_t_2 != 0);
2870  if (__pyx_t_3) {
2871 
2872  /* "BoundaryConditions.py":18
2873  * self.BC_type = 'None'
2874  * if shape is not None:
2875  * self.nd = self.Shape.Domain.nd # <<<<<<<<<<<<<<
2876  * elif nd is not None:
2877  * self.nd = nd
2878  */
2879  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->Shape, __pyx_n_s_Domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
2880  __Pyx_GOTREF(__pyx_t_1);
2881  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nd); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 18, __pyx_L1_error)
2882  __Pyx_GOTREF(__pyx_t_4);
2883  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2884  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L1_error)
2885  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2886  __pyx_v_self->nd = __pyx_t_5;
2887 
2888  /* "BoundaryConditions.py":17
2889  * self.name = name
2890  * self.BC_type = 'None'
2891  * if shape is not None: # <<<<<<<<<<<<<<
2892  * self.nd = self.Shape.Domain.nd
2893  * elif nd is not None:
2894  */
2895  goto __pyx_L3;
2896  }
2897 
2898  /* "BoundaryConditions.py":19
2899  * if shape is not None:
2900  * self.nd = self.Shape.Domain.nd
2901  * elif nd is not None: # <<<<<<<<<<<<<<
2902  * self.nd = nd
2903  * else:
2904  */
2905  __pyx_t_3 = (__pyx_v_nd != Py_None);
2906  __pyx_t_2 = (__pyx_t_3 != 0);
2907  if (__pyx_t_2) {
2908 
2909  /* "BoundaryConditions.py":20
2910  * self.nd = self.Shape.Domain.nd
2911  * elif nd is not None:
2912  * self.nd = nd # <<<<<<<<<<<<<<
2913  * else:
2914  * assert nd is not None, 'Shape or nd must be passed to BC'
2915  */
2916  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_nd); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L1_error)
2917  __pyx_v_self->nd = __pyx_t_5;
2918 
2919  /* "BoundaryConditions.py":19
2920  * if shape is not None:
2921  * self.nd = self.Shape.Domain.nd
2922  * elif nd is not None: # <<<<<<<<<<<<<<
2923  * self.nd = nd
2924  * else:
2925  */
2926  goto __pyx_L3;
2927  }
2928 
2929  /* "BoundaryConditions.py":22
2930  * self.nd = nd
2931  * else:
2932  * assert nd is not None, 'Shape or nd must be passed to BC' # <<<<<<<<<<<<<<
2933  * if b_or is not None:
2934  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
2935  */
2936  /*else*/ {
2937  #ifndef CYTHON_WITHOUT_ASSERTIONS
2938  if (unlikely(!Py_OptimizeFlag)) {
2939  __pyx_t_2 = (__pyx_v_nd != Py_None);
2940  if (unlikely(!(__pyx_t_2 != 0))) {
2941  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Shape_or_nd_must_be_passed_to_BC);
2942  __PYX_ERR(0, 22, __pyx_L1_error)
2943  }
2944  }
2945  #endif
2946  }
2947  __pyx_L3:;
2948 
2949  /* "BoundaryConditions.py":23
2950  * else:
2951  * assert nd is not None, 'Shape or nd must be passed to BC'
2952  * if b_or is not None: # <<<<<<<<<<<<<<
2953  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
2954  * else:
2955  */
2956  __pyx_t_2 = (__pyx_v_b_or != Py_None);
2957  __pyx_t_3 = (__pyx_t_2 != 0);
2958  if (__pyx_t_3) {
2959 
2960  /* "BoundaryConditions.py":24
2961  * assert nd is not None, 'Shape or nd must be passed to BC'
2962  * if b_or is not None:
2963  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape # <<<<<<<<<<<<<<
2964  * else:
2965  * self._b_or = None
2966  */
2967  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_b_or, __pyx_v_b_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error)
2968  __Pyx_GOTREF(__pyx_t_4);
2969  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 24, __pyx_L1_error)
2970  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2971  __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
2972  __pyx_v_self->_b_or = __pyx_t_6;
2973  __pyx_t_6.memview = NULL;
2974  __pyx_t_6.data = NULL;
2975 
2976  /* "BoundaryConditions.py":23
2977  * else:
2978  * assert nd is not None, 'Shape or nd must be passed to BC'
2979  * if b_or is not None: # <<<<<<<<<<<<<<
2980  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
2981  * else:
2982  */
2983  goto __pyx_L4;
2984  }
2985 
2986  /* "BoundaryConditions.py":26
2987  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
2988  * else:
2989  * self._b_or = None # <<<<<<<<<<<<<<
2990  *
2991  * # @staticmethod
2992  */
2993  /*else*/ {
2994  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 26, __pyx_L1_error)
2995  __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
2996  __pyx_v_self->_b_or = __pyx_t_6;
2997  __pyx_t_6.memview = NULL;
2998  __pyx_t_6.data = NULL;
2999  }
3000  __pyx_L4:;
3001 
3002  /* "BoundaryConditions.py":13
3003  * Generic class regrouping boundary conditions
3004  * """
3005  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None): # <<<<<<<<<<<<<<
3006  * self.Shape = shape
3007  * self.name = name
3008  */
3009 
3010  /* function exit code */
3011  __pyx_r = 0;
3012  goto __pyx_L0;
3013  __pyx_L1_error:;
3014  __Pyx_XDECREF(__pyx_t_1);
3015  __Pyx_XDECREF(__pyx_t_4);
3016  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
3017  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3018  __pyx_r = -1;
3019  __pyx_L0:;
3020  __Pyx_RefNannyFinishContext();
3021  return __pyx_r;
3022 }
3023 
3024 /* "BoundaryConditions.py":41
3025  * # setattr(BC_Base, name, default_value)
3026  *
3027  * def getContext(self, context=None): # <<<<<<<<<<<<<<
3028  * """
3029  * Gets context from proteus.Context or
3030  */
3031 
3032 /* Python wrapper */
3033 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3034 static char __pyx_doc_18BoundaryConditions_7BC_Base_2getContext[] = "\n Gets context from proteus.Context or\n\n Parameters\n ----------\n context: class, optional\n if set to None, the context will be created from proteus.Context\n ";
3035 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_3getContext = {"getContext", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext};
3036 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3037  PyObject *__pyx_v_context = 0;
3038  PyObject *__pyx_r = 0;
3039  __Pyx_RefNannyDeclarations
3040  __Pyx_RefNannySetupContext("getContext (wrapper)", 0);
3041  {
3042  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
3043  PyObject* values[1] = {0};
3044  values[0] = ((PyObject *)Py_None);
3045  if (unlikely(__pyx_kwds)) {
3046  Py_ssize_t kw_args;
3047  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3048  switch (pos_args) {
3049  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3050  CYTHON_FALLTHROUGH;
3051  case 0: break;
3052  default: goto __pyx_L5_argtuple_error;
3053  }
3054  kw_args = PyDict_Size(__pyx_kwds);
3055  switch (pos_args) {
3056  case 0:
3057  if (kw_args > 0) {
3058  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
3059  if (value) { values[0] = value; kw_args--; }
3060  }
3061  }
3062  if (unlikely(kw_args > 0)) {
3063  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getContext") < 0)) __PYX_ERR(0, 41, __pyx_L3_error)
3064  }
3065  } else {
3066  switch (PyTuple_GET_SIZE(__pyx_args)) {
3067  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3068  CYTHON_FALLTHROUGH;
3069  case 0: break;
3070  default: goto __pyx_L5_argtuple_error;
3071  }
3072  }
3073  __pyx_v_context = values[0];
3074  }
3075  goto __pyx_L4_argument_unpacking_done;
3076  __pyx_L5_argtuple_error:;
3077  __Pyx_RaiseArgtupleInvalid("getContext", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 41, __pyx_L3_error)
3078  __pyx_L3_error:;
3079  __Pyx_AddTraceback("BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3080  __Pyx_RefNannyFinishContext();
3081  return NULL;
3082  __pyx_L4_argument_unpacking_done:;
3083  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2getContext(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_context);
3084 
3085  /* function exit code */
3086  __Pyx_RefNannyFinishContext();
3087  return __pyx_r;
3088 }
3089 
3090 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context) {
3091  PyObject *__pyx_v_Context = NULL;
3092  PyObject *__pyx_r = NULL;
3093  __Pyx_RefNannyDeclarations
3094  int __pyx_t_1;
3095  PyObject *__pyx_t_2 = NULL;
3096  PyObject *__pyx_t_3 = NULL;
3097  PyObject *__pyx_t_4 = NULL;
3098  __Pyx_RefNannySetupContext("getContext", 0);
3099 
3100  /* "BoundaryConditions.py":50
3101  * if set to None, the context will be created from proteus.Context
3102  * """
3103  * if context: # <<<<<<<<<<<<<<
3104  * from proteus import Context
3105  * self.ct = Context.get()
3106  */
3107  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_context); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 50, __pyx_L1_error)
3108  if (__pyx_t_1) {
3109 
3110  /* "BoundaryConditions.py":51
3111  * """
3112  * if context:
3113  * from proteus import Context # <<<<<<<<<<<<<<
3114  * self.ct = Context.get()
3115  * else:
3116  */
3117  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
3118  __Pyx_GOTREF(__pyx_t_2);
3119  __Pyx_INCREF(__pyx_n_s_Context);
3120  __Pyx_GIVEREF(__pyx_n_s_Context);
3121  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Context);
3122  __pyx_t_3 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error)
3123  __Pyx_GOTREF(__pyx_t_3);
3124  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3125  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Context); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
3126  __Pyx_GOTREF(__pyx_t_2);
3127  __Pyx_INCREF(__pyx_t_2);
3128  __pyx_v_Context = __pyx_t_2;
3129  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3130  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3131 
3132  /* "BoundaryConditions.py":52
3133  * if context:
3134  * from proteus import Context
3135  * self.ct = Context.get() # <<<<<<<<<<<<<<
3136  * else:
3137  * self.ct = context
3138  */
3139  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_Context, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
3140  __Pyx_GOTREF(__pyx_t_2);
3141  __pyx_t_4 = NULL;
3142  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3143  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3144  if (likely(__pyx_t_4)) {
3145  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3146  __Pyx_INCREF(__pyx_t_4);
3147  __Pyx_INCREF(function);
3148  __Pyx_DECREF_SET(__pyx_t_2, function);
3149  }
3150  }
3151  if (__pyx_t_4) {
3152  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error)
3153  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3154  } else {
3155  __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error)
3156  }
3157  __Pyx_GOTREF(__pyx_t_3);
3158  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3159  __Pyx_GIVEREF(__pyx_t_3);
3160  __Pyx_GOTREF(__pyx_v_self->ct);
3161  __Pyx_DECREF(__pyx_v_self->ct);
3162  __pyx_v_self->ct = __pyx_t_3;
3163  __pyx_t_3 = 0;
3164 
3165  /* "BoundaryConditions.py":50
3166  * if set to None, the context will be created from proteus.Context
3167  * """
3168  * if context: # <<<<<<<<<<<<<<
3169  * from proteus import Context
3170  * self.ct = Context.get()
3171  */
3172  goto __pyx_L3;
3173  }
3174 
3175  /* "BoundaryConditions.py":54
3176  * self.ct = Context.get()
3177  * else:
3178  * self.ct = context # <<<<<<<<<<<<<<
3179  *
3180  *
3181  */
3182  /*else*/ {
3183  __Pyx_INCREF(__pyx_v_context);
3184  __Pyx_GIVEREF(__pyx_v_context);
3185  __Pyx_GOTREF(__pyx_v_self->ct);
3186  __Pyx_DECREF(__pyx_v_self->ct);
3187  __pyx_v_self->ct = __pyx_v_context;
3188  }
3189  __pyx_L3:;
3190 
3191  /* "BoundaryConditions.py":41
3192  * # setattr(BC_Base, name, default_value)
3193  *
3194  * def getContext(self, context=None): # <<<<<<<<<<<<<<
3195  * """
3196  * Gets context from proteus.Context or
3197  */
3198 
3199  /* function exit code */
3200  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3201  goto __pyx_L0;
3202  __pyx_L1_error:;
3203  __Pyx_XDECREF(__pyx_t_2);
3204  __Pyx_XDECREF(__pyx_t_3);
3205  __Pyx_XDECREF(__pyx_t_4);
3206  __Pyx_AddTraceback("BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3207  __pyx_r = NULL;
3208  __pyx_L0:;
3209  __Pyx_XDECREF(__pyx_v_Context);
3210  __Pyx_XGIVEREF(__pyx_r);
3211  __Pyx_RefNannyFinishContext();
3212  return __pyx_r;
3213 }
3214 
3215 /* "BoundaryConditions.pxd":8
3216  * cdef double[:] _b_or
3217  * cdef public:
3218  * cdef int nd # <<<<<<<<<<<<<<
3219  * object Shape
3220  * str name
3221  */
3222 
3223 /* Python wrapper */
3224 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self); /*proto*/
3225 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self) {
3226  PyObject *__pyx_r = 0;
3227  __Pyx_RefNannyDeclarations
3228  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3229  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3230 
3231  /* function exit code */
3232  __Pyx_RefNannyFinishContext();
3233  return __pyx_r;
3234 }
3235 
3236 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3237  PyObject *__pyx_r = NULL;
3238  __Pyx_RefNannyDeclarations
3239  PyObject *__pyx_t_1 = NULL;
3240  __Pyx_RefNannySetupContext("__get__", 0);
3241  __Pyx_XDECREF(__pyx_r);
3242  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nd); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
3243  __Pyx_GOTREF(__pyx_t_1);
3244  __pyx_r = __pyx_t_1;
3245  __pyx_t_1 = 0;
3246  goto __pyx_L0;
3247 
3248  /* function exit code */
3249  __pyx_L1_error:;
3250  __Pyx_XDECREF(__pyx_t_1);
3251  __Pyx_AddTraceback("BoundaryConditions.BC_Base.nd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3252  __pyx_r = NULL;
3253  __pyx_L0:;
3254  __Pyx_XGIVEREF(__pyx_r);
3255  __Pyx_RefNannyFinishContext();
3256  return __pyx_r;
3257 }
3258 
3259 /* Python wrapper */
3260 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3261 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3262  int __pyx_r;
3263  __Pyx_RefNannyDeclarations
3264  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3265  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3266 
3267  /* function exit code */
3268  __Pyx_RefNannyFinishContext();
3269  return __pyx_r;
3270 }
3271 
3272 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3273  int __pyx_r;
3274  __Pyx_RefNannyDeclarations
3275  int __pyx_t_1;
3276  __Pyx_RefNannySetupContext("__set__", 0);
3277  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8, __pyx_L1_error)
3278  __pyx_v_self->nd = __pyx_t_1;
3279 
3280  /* function exit code */
3281  __pyx_r = 0;
3282  goto __pyx_L0;
3283  __pyx_L1_error:;
3284  __Pyx_AddTraceback("BoundaryConditions.BC_Base.nd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3285  __pyx_r = -1;
3286  __pyx_L0:;
3287  __Pyx_RefNannyFinishContext();
3288  return __pyx_r;
3289 }
3290 
3291 /* "BoundaryConditions.pxd":9
3292  * cdef public:
3293  * cdef int nd
3294  * object Shape # <<<<<<<<<<<<<<
3295  * str name
3296  * str BC_type
3297  */
3298 
3299 /* Python wrapper */
3300 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self); /*proto*/
3301 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self) {
3302  PyObject *__pyx_r = 0;
3303  __Pyx_RefNannyDeclarations
3304  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3305  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3306 
3307  /* function exit code */
3308  __Pyx_RefNannyFinishContext();
3309  return __pyx_r;
3310 }
3311 
3312 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3313  PyObject *__pyx_r = NULL;
3314  __Pyx_RefNannyDeclarations
3315  __Pyx_RefNannySetupContext("__get__", 0);
3316  __Pyx_XDECREF(__pyx_r);
3317  __Pyx_INCREF(__pyx_v_self->Shape);
3318  __pyx_r = __pyx_v_self->Shape;
3319  goto __pyx_L0;
3320 
3321  /* function exit code */
3322  __pyx_L0:;
3323  __Pyx_XGIVEREF(__pyx_r);
3324  __Pyx_RefNannyFinishContext();
3325  return __pyx_r;
3326 }
3327 
3328 /* Python wrapper */
3329 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3330 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3331  int __pyx_r;
3332  __Pyx_RefNannyDeclarations
3333  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3334  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3335 
3336  /* function exit code */
3337  __Pyx_RefNannyFinishContext();
3338  return __pyx_r;
3339 }
3340 
3341 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3342  int __pyx_r;
3343  __Pyx_RefNannyDeclarations
3344  __Pyx_RefNannySetupContext("__set__", 0);
3345  __Pyx_INCREF(__pyx_v_value);
3346  __Pyx_GIVEREF(__pyx_v_value);
3347  __Pyx_GOTREF(__pyx_v_self->Shape);
3348  __Pyx_DECREF(__pyx_v_self->Shape);
3349  __pyx_v_self->Shape = __pyx_v_value;
3350 
3351  /* function exit code */
3352  __pyx_r = 0;
3353  __Pyx_RefNannyFinishContext();
3354  return __pyx_r;
3355 }
3356 
3357 /* Python wrapper */
3358 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self); /*proto*/
3359 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self) {
3360  int __pyx_r;
3361  __Pyx_RefNannyDeclarations
3362  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3363  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3364 
3365  /* function exit code */
3366  __Pyx_RefNannyFinishContext();
3367  return __pyx_r;
3368 }
3369 
3370 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3371  int __pyx_r;
3372  __Pyx_RefNannyDeclarations
3373  __Pyx_RefNannySetupContext("__del__", 0);
3374  __Pyx_INCREF(Py_None);
3375  __Pyx_GIVEREF(Py_None);
3376  __Pyx_GOTREF(__pyx_v_self->Shape);
3377  __Pyx_DECREF(__pyx_v_self->Shape);
3378  __pyx_v_self->Shape = Py_None;
3379 
3380  /* function exit code */
3381  __pyx_r = 0;
3382  __Pyx_RefNannyFinishContext();
3383  return __pyx_r;
3384 }
3385 
3386 /* "BoundaryConditions.pxd":10
3387  * cdef int nd
3388  * object Shape
3389  * str name # <<<<<<<<<<<<<<
3390  * str BC_type
3391  * object ct
3392  */
3393 
3394 /* Python wrapper */
3395 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
3396 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self) {
3397  PyObject *__pyx_r = 0;
3398  __Pyx_RefNannyDeclarations
3399  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3400  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3401 
3402  /* function exit code */
3403  __Pyx_RefNannyFinishContext();
3404  return __pyx_r;
3405 }
3406 
3407 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3408  PyObject *__pyx_r = NULL;
3409  __Pyx_RefNannyDeclarations
3410  __Pyx_RefNannySetupContext("__get__", 0);
3411  __Pyx_XDECREF(__pyx_r);
3412  __Pyx_INCREF(__pyx_v_self->name);
3413  __pyx_r = __pyx_v_self->name;
3414  goto __pyx_L0;
3415 
3416  /* function exit code */
3417  __pyx_L0:;
3418  __Pyx_XGIVEREF(__pyx_r);
3419  __Pyx_RefNannyFinishContext();
3420  return __pyx_r;
3421 }
3422 
3423 /* Python wrapper */
3424 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3425 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3426  int __pyx_r;
3427  __Pyx_RefNannyDeclarations
3428  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3429  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3430 
3431  /* function exit code */
3432  __Pyx_RefNannyFinishContext();
3433  return __pyx_r;
3434 }
3435 
3436 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3437  int __pyx_r;
3438  __Pyx_RefNannyDeclarations
3439  PyObject *__pyx_t_1 = NULL;
3440  __Pyx_RefNannySetupContext("__set__", 0);
3441  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error)
3442  __pyx_t_1 = __pyx_v_value;
3443  __Pyx_INCREF(__pyx_t_1);
3444  __Pyx_GIVEREF(__pyx_t_1);
3445  __Pyx_GOTREF(__pyx_v_self->name);
3446  __Pyx_DECREF(__pyx_v_self->name);
3447  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3448  __pyx_t_1 = 0;
3449 
3450  /* function exit code */
3451  __pyx_r = 0;
3452  goto __pyx_L0;
3453  __pyx_L1_error:;
3454  __Pyx_XDECREF(__pyx_t_1);
3455  __Pyx_AddTraceback("BoundaryConditions.BC_Base.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3456  __pyx_r = -1;
3457  __pyx_L0:;
3458  __Pyx_RefNannyFinishContext();
3459  return __pyx_r;
3460 }
3461 
3462 /* Python wrapper */
3463 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
3464 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self) {
3465  int __pyx_r;
3466  __Pyx_RefNannyDeclarations
3467  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3468  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3469 
3470  /* function exit code */
3471  __Pyx_RefNannyFinishContext();
3472  return __pyx_r;
3473 }
3474 
3475 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3476  int __pyx_r;
3477  __Pyx_RefNannyDeclarations
3478  __Pyx_RefNannySetupContext("__del__", 0);
3479  __Pyx_INCREF(Py_None);
3480  __Pyx_GIVEREF(Py_None);
3481  __Pyx_GOTREF(__pyx_v_self->name);
3482  __Pyx_DECREF(__pyx_v_self->name);
3483  __pyx_v_self->name = ((PyObject*)Py_None);
3484 
3485  /* function exit code */
3486  __pyx_r = 0;
3487  __Pyx_RefNannyFinishContext();
3488  return __pyx_r;
3489 }
3490 
3491 /* "BoundaryConditions.pxd":11
3492  * object Shape
3493  * str name
3494  * str BC_type # <<<<<<<<<<<<<<
3495  * object ct
3496  * # cpdef void newGlobalBC(BC_Base cls, newstr name, object default_value)
3497  */
3498 
3499 /* Python wrapper */
3500 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self); /*proto*/
3501 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self) {
3502  PyObject *__pyx_r = 0;
3503  __Pyx_RefNannyDeclarations
3504  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3505  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3506 
3507  /* function exit code */
3508  __Pyx_RefNannyFinishContext();
3509  return __pyx_r;
3510 }
3511 
3512 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3513  PyObject *__pyx_r = NULL;
3514  __Pyx_RefNannyDeclarations
3515  __Pyx_RefNannySetupContext("__get__", 0);
3516  __Pyx_XDECREF(__pyx_r);
3517  __Pyx_INCREF(__pyx_v_self->BC_type);
3518  __pyx_r = __pyx_v_self->BC_type;
3519  goto __pyx_L0;
3520 
3521  /* function exit code */
3522  __pyx_L0:;
3523  __Pyx_XGIVEREF(__pyx_r);
3524  __Pyx_RefNannyFinishContext();
3525  return __pyx_r;
3526 }
3527 
3528 /* Python wrapper */
3529 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3530 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3531  int __pyx_r;
3532  __Pyx_RefNannyDeclarations
3533  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3534  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3535 
3536  /* function exit code */
3537  __Pyx_RefNannyFinishContext();
3538  return __pyx_r;
3539 }
3540 
3541 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3542  int __pyx_r;
3543  __Pyx_RefNannyDeclarations
3544  PyObject *__pyx_t_1 = NULL;
3545  __Pyx_RefNannySetupContext("__set__", 0);
3546  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 11, __pyx_L1_error)
3547  __pyx_t_1 = __pyx_v_value;
3548  __Pyx_INCREF(__pyx_t_1);
3549  __Pyx_GIVEREF(__pyx_t_1);
3550  __Pyx_GOTREF(__pyx_v_self->BC_type);
3551  __Pyx_DECREF(__pyx_v_self->BC_type);
3552  __pyx_v_self->BC_type = ((PyObject*)__pyx_t_1);
3553  __pyx_t_1 = 0;
3554 
3555  /* function exit code */
3556  __pyx_r = 0;
3557  goto __pyx_L0;
3558  __pyx_L1_error:;
3559  __Pyx_XDECREF(__pyx_t_1);
3560  __Pyx_AddTraceback("BoundaryConditions.BC_Base.BC_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3561  __pyx_r = -1;
3562  __pyx_L0:;
3563  __Pyx_RefNannyFinishContext();
3564  return __pyx_r;
3565 }
3566 
3567 /* Python wrapper */
3568 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self); /*proto*/
3569 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self) {
3570  int __pyx_r;
3571  __Pyx_RefNannyDeclarations
3572  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3573  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3574 
3575  /* function exit code */
3576  __Pyx_RefNannyFinishContext();
3577  return __pyx_r;
3578 }
3579 
3580 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3581  int __pyx_r;
3582  __Pyx_RefNannyDeclarations
3583  __Pyx_RefNannySetupContext("__del__", 0);
3584  __Pyx_INCREF(Py_None);
3585  __Pyx_GIVEREF(Py_None);
3586  __Pyx_GOTREF(__pyx_v_self->BC_type);
3587  __Pyx_DECREF(__pyx_v_self->BC_type);
3588  __pyx_v_self->BC_type = ((PyObject*)Py_None);
3589 
3590  /* function exit code */
3591  __pyx_r = 0;
3592  __Pyx_RefNannyFinishContext();
3593  return __pyx_r;
3594 }
3595 
3596 /* "BoundaryConditions.pxd":12
3597  * str name
3598  * str BC_type
3599  * object ct # <<<<<<<<<<<<<<
3600  * # cpdef void newGlobalBC(BC_Base cls, newstr name, object default_value)
3601  * # cpdef void getContext(BC_Base cls, object context=*)
3602  */
3603 
3604 /* Python wrapper */
3605 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self); /*proto*/
3606 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self) {
3607  PyObject *__pyx_r = 0;
3608  __Pyx_RefNannyDeclarations
3609  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3610  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3611 
3612  /* function exit code */
3613  __Pyx_RefNannyFinishContext();
3614  return __pyx_r;
3615 }
3616 
3617 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3618  PyObject *__pyx_r = NULL;
3619  __Pyx_RefNannyDeclarations
3620  __Pyx_RefNannySetupContext("__get__", 0);
3621  __Pyx_XDECREF(__pyx_r);
3622  __Pyx_INCREF(__pyx_v_self->ct);
3623  __pyx_r = __pyx_v_self->ct;
3624  goto __pyx_L0;
3625 
3626  /* function exit code */
3627  __pyx_L0:;
3628  __Pyx_XGIVEREF(__pyx_r);
3629  __Pyx_RefNannyFinishContext();
3630  return __pyx_r;
3631 }
3632 
3633 /* Python wrapper */
3634 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3635 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3636  int __pyx_r;
3637  __Pyx_RefNannyDeclarations
3638  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3639  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3640 
3641  /* function exit code */
3642  __Pyx_RefNannyFinishContext();
3643  return __pyx_r;
3644 }
3645 
3646 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3647  int __pyx_r;
3648  __Pyx_RefNannyDeclarations
3649  __Pyx_RefNannySetupContext("__set__", 0);
3650  __Pyx_INCREF(__pyx_v_value);
3651  __Pyx_GIVEREF(__pyx_v_value);
3652  __Pyx_GOTREF(__pyx_v_self->ct);
3653  __Pyx_DECREF(__pyx_v_self->ct);
3654  __pyx_v_self->ct = __pyx_v_value;
3655 
3656  /* function exit code */
3657  __pyx_r = 0;
3658  __Pyx_RefNannyFinishContext();
3659  return __pyx_r;
3660 }
3661 
3662 /* Python wrapper */
3663 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self); /*proto*/
3664 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self) {
3665  int __pyx_r;
3666  __Pyx_RefNannyDeclarations
3667  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3668  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3669 
3670  /* function exit code */
3671  __Pyx_RefNannyFinishContext();
3672  return __pyx_r;
3673 }
3674 
3675 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3676  int __pyx_r;
3677  __Pyx_RefNannyDeclarations
3678  __Pyx_RefNannySetupContext("__del__", 0);
3679  __Pyx_INCREF(Py_None);
3680  __Pyx_GIVEREF(Py_None);
3681  __Pyx_GOTREF(__pyx_v_self->ct);
3682  __Pyx_DECREF(__pyx_v_self->ct);
3683  __pyx_v_self->ct = Py_None;
3684 
3685  /* function exit code */
3686  __pyx_r = 0;
3687  __Pyx_RefNannyFinishContext();
3688  return __pyx_r;
3689 }
3690 
3691 /* "(tree fragment)":1
3692  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3693  * cdef bint use_setstate
3694  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
3695  */
3696 
3697 /* Python wrapper */
3698 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3699 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, 0};
3700 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3701  PyObject *__pyx_r = 0;
3702  __Pyx_RefNannyDeclarations
3703  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3704  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3705 
3706  /* function exit code */
3707  __Pyx_RefNannyFinishContext();
3708  return __pyx_r;
3709 }
3710 
3711 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3712  int __pyx_v_use_setstate;
3713  PyObject *__pyx_v_state = NULL;
3714  PyObject *__pyx_v__dict = NULL;
3715  PyObject *__pyx_r = NULL;
3716  __Pyx_RefNannyDeclarations
3717  PyObject *__pyx_t_1 = NULL;
3718  PyObject *__pyx_t_2 = NULL;
3719  PyObject *__pyx_t_3 = NULL;
3720  int __pyx_t_4;
3721  int __pyx_t_5;
3722  int __pyx_t_6;
3723  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3724 
3725  /* "(tree fragment)":3
3726  * def __reduce_cython__(self):
3727  * cdef bint use_setstate
3728  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd) # <<<<<<<<<<<<<<
3729  * _dict = getattr(self, '__dict__', None)
3730  * if _dict is not None:
3731  */
3732  if (unlikely(!__pyx_v_self->_b_or.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)}
3733  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->_b_or, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
3734  __Pyx_GOTREF(__pyx_t_1);
3735  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nd); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
3736  __Pyx_GOTREF(__pyx_t_2);
3737  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
3738  __Pyx_GOTREF(__pyx_t_3);
3739  __Pyx_INCREF(__pyx_v_self->BC_type);
3740  __Pyx_GIVEREF(__pyx_v_self->BC_type);
3741  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->BC_type);
3742  __Pyx_INCREF(__pyx_v_self->Shape);
3743  __Pyx_GIVEREF(__pyx_v_self->Shape);
3744  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->Shape);
3745  __Pyx_GIVEREF(__pyx_t_1);
3746  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
3747  __Pyx_INCREF(__pyx_v_self->ct);
3748  __Pyx_GIVEREF(__pyx_v_self->ct);
3749  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->ct);
3750  __Pyx_INCREF(__pyx_v_self->name);
3751  __Pyx_GIVEREF(__pyx_v_self->name);
3752  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_self->name);
3753  __Pyx_GIVEREF(__pyx_t_2);
3754  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_2);
3755  __pyx_t_1 = 0;
3756  __pyx_t_2 = 0;
3757  __pyx_v_state = ((PyObject*)__pyx_t_3);
3758  __pyx_t_3 = 0;
3759 
3760  /* "(tree fragment)":4
3761  * cdef bint use_setstate
3762  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
3763  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
3764  * if _dict is not None:
3765  * state += (_dict,)
3766  */
3767  __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
3768  __Pyx_GOTREF(__pyx_t_3);
3769  __pyx_v__dict = __pyx_t_3;
3770  __pyx_t_3 = 0;
3771 
3772  /* "(tree fragment)":5
3773  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
3774  * _dict = getattr(self, '__dict__', None)
3775  * if _dict is not None: # <<<<<<<<<<<<<<
3776  * state += (_dict,)
3777  * use_setstate = True
3778  */
3779  __pyx_t_4 = (__pyx_v__dict != Py_None);
3780  __pyx_t_5 = (__pyx_t_4 != 0);
3781  if (__pyx_t_5) {
3782 
3783  /* "(tree fragment)":6
3784  * _dict = getattr(self, '__dict__', None)
3785  * if _dict is not None:
3786  * state += (_dict,) # <<<<<<<<<<<<<<
3787  * use_setstate = True
3788  * else:
3789  */
3790  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
3791  __Pyx_GOTREF(__pyx_t_3);
3792  __Pyx_INCREF(__pyx_v__dict);
3793  __Pyx_GIVEREF(__pyx_v__dict);
3794  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
3795  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
3796  __Pyx_GOTREF(__pyx_t_2);
3797  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3798  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
3799  __pyx_t_2 = 0;
3800 
3801  /* "(tree fragment)":7
3802  * if _dict is not None:
3803  * state += (_dict,)
3804  * use_setstate = True # <<<<<<<<<<<<<<
3805  * else:
3806  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
3807  */
3808  __pyx_v_use_setstate = 1;
3809 
3810  /* "(tree fragment)":5
3811  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
3812  * _dict = getattr(self, '__dict__', None)
3813  * if _dict is not None: # <<<<<<<<<<<<<<
3814  * state += (_dict,)
3815  * use_setstate = True
3816  */
3817  goto __pyx_L3;
3818  }
3819 
3820  /* "(tree fragment)":9
3821  * use_setstate = True
3822  * else:
3823  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None # <<<<<<<<<<<<<<
3824  * if use_setstate:
3825  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
3826  */
3827  /*else*/ {
3828  __pyx_t_4 = (__pyx_v_self->BC_type != ((PyObject*)Py_None));
3829  __pyx_t_6 = (__pyx_t_4 != 0);
3830  if (!__pyx_t_6) {
3831  } else {
3832  __pyx_t_5 = __pyx_t_6;
3833  goto __pyx_L4_bool_binop_done;
3834  }
3835  __pyx_t_6 = (__pyx_v_self->Shape != Py_None);
3836  __pyx_t_4 = (__pyx_t_6 != 0);
3837  if (!__pyx_t_4) {
3838  } else {
3839  __pyx_t_5 = __pyx_t_4;
3840  goto __pyx_L4_bool_binop_done;
3841  }
3842  __pyx_t_4 = (__pyx_v_self->ct != Py_None);
3843  __pyx_t_6 = (__pyx_t_4 != 0);
3844  if (!__pyx_t_6) {
3845  } else {
3846  __pyx_t_5 = __pyx_t_6;
3847  goto __pyx_L4_bool_binop_done;
3848  }
3849  __pyx_t_6 = (__pyx_v_self->name != ((PyObject*)Py_None));
3850  __pyx_t_4 = (__pyx_t_6 != 0);
3851  __pyx_t_5 = __pyx_t_4;
3852  __pyx_L4_bool_binop_done:;
3853  __pyx_v_use_setstate = __pyx_t_5;
3854  }
3855  __pyx_L3:;
3856 
3857  /* "(tree fragment)":10
3858  * else:
3859  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
3860  * if use_setstate: # <<<<<<<<<<<<<<
3861  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
3862  * else:
3863  */
3864  __pyx_t_5 = (__pyx_v_use_setstate != 0);
3865  if (__pyx_t_5) {
3866 
3867  /* "(tree fragment)":11
3868  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
3869  * if use_setstate:
3870  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state # <<<<<<<<<<<<<<
3871  * else:
3872  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
3873  */
3874  __Pyx_XDECREF(__pyx_r);
3875  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_BC_Base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 11, __pyx_L1_error)
3876  __Pyx_GOTREF(__pyx_t_2);
3877  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 11, __pyx_L1_error)
3878  __Pyx_GOTREF(__pyx_t_3);
3879  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3880  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3881  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3882  __Pyx_INCREF(__pyx_int_158231071);
3883  __Pyx_GIVEREF(__pyx_int_158231071);
3884  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
3885  __Pyx_INCREF(Py_None);
3886  __Pyx_GIVEREF(Py_None);
3887  PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
3888  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error)
3889  __Pyx_GOTREF(__pyx_t_1);
3890  __Pyx_GIVEREF(__pyx_t_2);
3891  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
3892  __Pyx_GIVEREF(__pyx_t_3);
3893  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
3894  __Pyx_INCREF(__pyx_v_state);
3895  __Pyx_GIVEREF(__pyx_v_state);
3896  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
3897  __pyx_t_2 = 0;
3898  __pyx_t_3 = 0;
3899  __pyx_r = __pyx_t_1;
3900  __pyx_t_1 = 0;
3901  goto __pyx_L0;
3902 
3903  /* "(tree fragment)":10
3904  * else:
3905  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
3906  * if use_setstate: # <<<<<<<<<<<<<<
3907  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
3908  * else:
3909  */
3910  }
3911 
3912  /* "(tree fragment)":13
3913  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
3914  * else:
3915  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state) # <<<<<<<<<<<<<<
3916  * def __setstate_cython__(self, __pyx_state):
3917  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
3918  */
3919  /*else*/ {
3920  __Pyx_XDECREF(__pyx_r);
3921  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_BC_Base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
3922  __Pyx_GOTREF(__pyx_t_1);
3923  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
3924  __Pyx_GOTREF(__pyx_t_3);
3925  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3926  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3927  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3928  __Pyx_INCREF(__pyx_int_158231071);
3929  __Pyx_GIVEREF(__pyx_int_158231071);
3930  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
3931  __Pyx_INCREF(__pyx_v_state);
3932  __Pyx_GIVEREF(__pyx_v_state);
3933  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
3934  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
3935  __Pyx_GOTREF(__pyx_t_2);
3936  __Pyx_GIVEREF(__pyx_t_1);
3937  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
3938  __Pyx_GIVEREF(__pyx_t_3);
3939  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
3940  __pyx_t_1 = 0;
3941  __pyx_t_3 = 0;
3942  __pyx_r = __pyx_t_2;
3943  __pyx_t_2 = 0;
3944  goto __pyx_L0;
3945  }
3946 
3947  /* "(tree fragment)":1
3948  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3949  * cdef bint use_setstate
3950  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
3951  */
3952 
3953  /* function exit code */
3954  __pyx_L1_error:;
3955  __Pyx_XDECREF(__pyx_t_1);
3956  __Pyx_XDECREF(__pyx_t_2);
3957  __Pyx_XDECREF(__pyx_t_3);
3958  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3959  __pyx_r = NULL;
3960  __pyx_L0:;
3961  __Pyx_XDECREF(__pyx_v_state);
3962  __Pyx_XDECREF(__pyx_v__dict);
3963  __Pyx_XGIVEREF(__pyx_r);
3964  __Pyx_RefNannyFinishContext();
3965  return __pyx_r;
3966 }
3967 
3968 /* "(tree fragment)":14
3969  * else:
3970  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
3971  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3972  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
3973  */
3974 
3975 /* Python wrapper */
3976 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3977 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, 0};
3978 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3979  PyObject *__pyx_r = 0;
3980  __Pyx_RefNannyDeclarations
3981  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3982  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3983 
3984  /* function exit code */
3985  __Pyx_RefNannyFinishContext();
3986  return __pyx_r;
3987 }
3988 
3989 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3990  PyObject *__pyx_r = NULL;
3991  __Pyx_RefNannyDeclarations
3992  PyObject *__pyx_t_1 = NULL;
3993  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3994 
3995  /* "(tree fragment)":15
3996  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
3997  * def __setstate_cython__(self, __pyx_state):
3998  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
3999  */
4000  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error)
4001  __pyx_t_1 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
4002  __Pyx_GOTREF(__pyx_t_1);
4003  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4004 
4005  /* "(tree fragment)":14
4006  * else:
4007  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4008  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4009  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
4010  */
4011 
4012  /* function exit code */
4013  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4014  goto __pyx_L0;
4015  __pyx_L1_error:;
4016  __Pyx_XDECREF(__pyx_t_1);
4017  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4018  __pyx_r = NULL;
4019  __pyx_L0:;
4020  __Pyx_XGIVEREF(__pyx_r);
4021  __Pyx_RefNannyFinishContext();
4022  return __pyx_r;
4023 }
4024 
4025 /* "BoundaryConditions.py":67
4026  * no boundary condition
4027  * """
4028  * def __init__(self): # <<<<<<<<<<<<<<
4029  * self.uOfXT = None
4030  *
4031  */
4032 
4033 /* Python wrapper */
4034 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4035 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4036  int __pyx_r;
4037  __Pyx_RefNannyDeclarations
4038  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4039  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
4040  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
4041  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
4042  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4043 
4044  /* function exit code */
4045  __Pyx_RefNannyFinishContext();
4046  return __pyx_r;
4047 }
4048 
4049 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4050  int __pyx_r;
4051  __Pyx_RefNannyDeclarations
4052  __Pyx_RefNannySetupContext("__init__", 0);
4053 
4054  /* "BoundaryConditions.py":68
4055  * """
4056  * def __init__(self):
4057  * self.uOfXT = None # <<<<<<<<<<<<<<
4058  *
4059  * def init_cython(self):
4060  */
4061  __Pyx_INCREF(Py_None);
4062  __Pyx_GIVEREF(Py_None);
4063  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4064  __Pyx_DECREF(__pyx_v_self->uOfXT);
4065  __pyx_v_self->uOfXT = Py_None;
4066 
4067  /* "BoundaryConditions.py":67
4068  * no boundary condition
4069  * """
4070  * def __init__(self): # <<<<<<<<<<<<<<
4071  * self.uOfXT = None
4072  *
4073  */
4074 
4075  /* function exit code */
4076  __pyx_r = 0;
4077  __Pyx_RefNannyFinishContext();
4078  return __pyx_r;
4079 }
4080 
4081 /* "BoundaryConditions.py":70
4082  * self.uOfXT = None
4083  *
4084  * def init_cython(self): # <<<<<<<<<<<<<<
4085  * return self.uOfXT
4086  *
4087  */
4088 
4089 /* Python wrapper */
4090 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4091 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython = {"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, 0};
4092 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4093  PyObject *__pyx_r = 0;
4094  __Pyx_RefNannyDeclarations
4095  __Pyx_RefNannySetupContext("init_cython (wrapper)", 0);
4096  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4097 
4098  /* function exit code */
4099  __Pyx_RefNannyFinishContext();
4100  return __pyx_r;
4101 }
4102 
4103 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4104  PyObject *__pyx_r = NULL;
4105  __Pyx_RefNannyDeclarations
4106  __Pyx_RefNannySetupContext("init_cython", 0);
4107 
4108  /* "BoundaryConditions.py":71
4109  *
4110  * def init_cython(self):
4111  * return self.uOfXT # <<<<<<<<<<<<<<
4112  *
4113  * def resetBC(self):
4114  */
4115  __Pyx_XDECREF(__pyx_r);
4116  __Pyx_INCREF(__pyx_v_self->uOfXT);
4117  __pyx_r = __pyx_v_self->uOfXT;
4118  goto __pyx_L0;
4119 
4120  /* "BoundaryConditions.py":70
4121  * self.uOfXT = None
4122  *
4123  * def init_cython(self): # <<<<<<<<<<<<<<
4124  * return self.uOfXT
4125  *
4126  */
4127 
4128  /* function exit code */
4129  __pyx_L0:;
4130  __Pyx_XGIVEREF(__pyx_r);
4131  __Pyx_RefNannyFinishContext();
4132  return __pyx_r;
4133 }
4134 
4135 /* "BoundaryConditions.py":73
4136  * return self.uOfXT
4137  *
4138  * def resetBC(self): # <<<<<<<<<<<<<<
4139  * self.uOfXT = None
4140  *
4141  */
4142 
4143 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4144 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, int __pyx_skip_dispatch) {
4145  __Pyx_RefNannyDeclarations
4146  PyObject *__pyx_t_1 = NULL;
4147  PyObject *__pyx_t_2 = NULL;
4148  PyObject *__pyx_t_3 = NULL;
4149  PyObject *__pyx_t_4 = NULL;
4150  __Pyx_RefNannySetupContext("resetBC", 0);
4151  /* Check if called by wrapper */
4152  if (unlikely(__pyx_skip_dispatch)) ;
4153  /* Check if overridden in Python */
4154  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
4155  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resetBC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
4156  __Pyx_GOTREF(__pyx_t_1);
4157  if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC)) {
4158  __Pyx_INCREF(__pyx_t_1);
4159  __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
4160  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4161  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4162  if (likely(__pyx_t_4)) {
4163  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4164  __Pyx_INCREF(__pyx_t_4);
4165  __Pyx_INCREF(function);
4166  __Pyx_DECREF_SET(__pyx_t_3, function);
4167  }
4168  }
4169  if (__pyx_t_4) {
4170  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
4171  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4172  } else {
4173  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
4174  }
4175  __Pyx_GOTREF(__pyx_t_2);
4176  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4177  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4178  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4179  goto __pyx_L0;
4180  }
4181  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4182  }
4183 
4184  /* "BoundaryConditions.py":74
4185  *
4186  * def resetBC(self):
4187  * self.uOfXT = None # <<<<<<<<<<<<<<
4188  *
4189  * def setConstantBC(self, value):
4190  */
4191  __Pyx_INCREF(Py_None);
4192  __Pyx_GIVEREF(Py_None);
4193  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4194  __Pyx_DECREF(__pyx_v_self->uOfXT);
4195  __pyx_v_self->uOfXT = Py_None;
4196 
4197  /* "BoundaryConditions.py":73
4198  * return self.uOfXT
4199  *
4200  * def resetBC(self): # <<<<<<<<<<<<<<
4201  * self.uOfXT = None
4202  *
4203  */
4204 
4205  /* function exit code */
4206  goto __pyx_L0;
4207  __pyx_L1_error:;
4208  __Pyx_XDECREF(__pyx_t_1);
4209  __Pyx_XDECREF(__pyx_t_2);
4210  __Pyx_XDECREF(__pyx_t_3);
4211  __Pyx_XDECREF(__pyx_t_4);
4212  __Pyx_WriteUnraisable("BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4213  __pyx_L0:;
4214  __Pyx_RefNannyFinishContext();
4215 }
4216 
4217 /* Python wrapper */
4218 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4219 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC = {"resetBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC, METH_NOARGS, 0};
4220 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4221  PyObject *__pyx_r = 0;
4222  __Pyx_RefNannyDeclarations
4223  __Pyx_RefNannySetupContext("resetBC (wrapper)", 0);
4224  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4225 
4226  /* function exit code */
4227  __Pyx_RefNannyFinishContext();
4228  return __pyx_r;
4229 }
4230 
4231 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4232  PyObject *__pyx_r = NULL;
4233  __Pyx_RefNannyDeclarations
4234  PyObject *__pyx_t_1 = NULL;
4235  __Pyx_RefNannySetupContext("resetBC", 0);
4236  __Pyx_XDECREF(__pyx_r);
4237  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
4238  __Pyx_GOTREF(__pyx_t_1);
4239  __pyx_r = __pyx_t_1;
4240  __pyx_t_1 = 0;
4241  goto __pyx_L0;
4242 
4243  /* function exit code */
4244  __pyx_L1_error:;
4245  __Pyx_XDECREF(__pyx_t_1);
4246  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4247  __pyx_r = NULL;
4248  __pyx_L0:;
4249  __Pyx_XGIVEREF(__pyx_r);
4250  __Pyx_RefNannyFinishContext();
4251  return __pyx_r;
4252 }
4253 
4254 /* "BoundaryConditions.py":76
4255  * self.uOfXT = None
4256  *
4257  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
4258  * """
4259  * function returning constant BC
4260  */
4261 
4262 /* Python wrapper */
4263 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
4264 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC[] = "\n function returning constant BC\n\n Parameters\n ----------\n value : float\n Constant value\n\n ";
4265 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC = {"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC};
4266 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4267  PyObject *__pyx_r = 0;
4268  __Pyx_RefNannyDeclarations
4269  __Pyx_RefNannySetupContext("setConstantBC (wrapper)", 0);
4270  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4271 
4272  /* function exit code */
4273  __Pyx_RefNannyFinishContext();
4274  return __pyx_r;
4275 }
4276 
4277 /* "BoundaryConditions.py":86
4278  *
4279  * """
4280  * self.uOfXT = lambda x, t: value # <<<<<<<<<<<<<<
4281  *
4282  *
4283  */
4284 
4285 /* Python wrapper */
4286 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4287 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda = {"lambda", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, METH_VARARGS|METH_KEYWORDS, 0};
4288 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4289  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
4290  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
4291  PyObject *__pyx_r = 0;
4292  __Pyx_RefNannyDeclarations
4293  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
4294  {
4295  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
4296  PyObject* values[2] = {0,0};
4297  if (unlikely(__pyx_kwds)) {
4298  Py_ssize_t kw_args;
4299  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4300  switch (pos_args) {
4301  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4302  CYTHON_FALLTHROUGH;
4303  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4304  CYTHON_FALLTHROUGH;
4305  case 0: break;
4306  default: goto __pyx_L5_argtuple_error;
4307  }
4308  kw_args = PyDict_Size(__pyx_kwds);
4309  switch (pos_args) {
4310  case 0:
4311  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4312  else goto __pyx_L5_argtuple_error;
4313  CYTHON_FALLTHROUGH;
4314  case 1:
4315  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4316  else {
4317  __Pyx_RaiseArgtupleInvalid("lambda", 1, 2, 2, 1); __PYX_ERR(0, 86, __pyx_L3_error)
4318  }
4319  }
4320  if (unlikely(kw_args > 0)) {
4321  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda") < 0)) __PYX_ERR(0, 86, __pyx_L3_error)
4322  }
4323  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4324  goto __pyx_L5_argtuple_error;
4325  } else {
4326  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4327  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4328  }
4329  __pyx_v_x = values[0];
4330  __pyx_v_t = values[1];
4331  }
4332  goto __pyx_L4_argument_unpacking_done;
4333  __pyx_L5_argtuple_error:;
4334  __Pyx_RaiseArgtupleInvalid("lambda", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 86, __pyx_L3_error)
4335  __pyx_L3_error:;
4336  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4337  __Pyx_RefNannyFinishContext();
4338  return NULL;
4339  __pyx_L4_argument_unpacking_done:;
4340  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_t);
4341 
4342  /* function exit code */
4343  __Pyx_RefNannyFinishContext();
4344  return __pyx_r;
4345 }
4346 
4347 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t) {
4348  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4349  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_outer_scope;
4350  PyObject *__pyx_r = NULL;
4351  __Pyx_RefNannyDeclarations
4352  __Pyx_RefNannySetupContext("lambda", 0);
4353  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
4354  __pyx_cur_scope = __pyx_outer_scope;
4355  __Pyx_XDECREF(__pyx_r);
4356  if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 86, __pyx_L1_error) }
4357  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4358  __pyx_r = __pyx_cur_scope->__pyx_v_value;
4359  goto __pyx_L0;
4360 
4361  /* function exit code */
4362  __pyx_L1_error:;
4363  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4364  __pyx_r = NULL;
4365  __pyx_L0:;
4366  __Pyx_XGIVEREF(__pyx_r);
4367  __Pyx_RefNannyFinishContext();
4368  return __pyx_r;
4369 }
4370 
4371 /* "BoundaryConditions.py":76
4372  * self.uOfXT = None
4373  *
4374  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
4375  * """
4376  * function returning constant BC
4377  */
4378 
4379 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
4380  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4381  PyObject *__pyx_r = NULL;
4382  __Pyx_RefNannyDeclarations
4383  PyObject *__pyx_t_1 = NULL;
4384  __Pyx_RefNannySetupContext("setConstantBC", 0);
4385  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC, __pyx_empty_tuple, NULL);
4386  if (unlikely(!__pyx_cur_scope)) {
4387  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)Py_None);
4388  __Pyx_INCREF(Py_None);
4389  __PYX_ERR(0, 76, __pyx_L1_error)
4390  } else {
4391  __Pyx_GOTREF(__pyx_cur_scope);
4392  }
4393  __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
4394  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4395  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
4396 
4397  /* "BoundaryConditions.py":86
4398  *
4399  * """
4400  * self.uOfXT = lambda x, t: value # <<<<<<<<<<<<<<
4401  *
4402  *
4403  */
4404  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, 0, __pyx_n_s_setConstantBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
4405  __Pyx_GOTREF(__pyx_t_1);
4406  __Pyx_GIVEREF(__pyx_t_1);
4407  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4408  __Pyx_DECREF(__pyx_v_self->uOfXT);
4409  __pyx_v_self->uOfXT = __pyx_t_1;
4410  __pyx_t_1 = 0;
4411 
4412  /* "BoundaryConditions.py":76
4413  * self.uOfXT = None
4414  *
4415  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
4416  * """
4417  * function returning constant BC
4418  */
4419 
4420  /* function exit code */
4421  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4422  goto __pyx_L0;
4423  __pyx_L1_error:;
4424  __Pyx_XDECREF(__pyx_t_1);
4425  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4426  __pyx_r = NULL;
4427  __pyx_L0:;
4428  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4429  __Pyx_XGIVEREF(__pyx_r);
4430  __Pyx_RefNannyFinishContext();
4431  return __pyx_r;
4432 }
4433 
4434 /* "BoundaryConditions.py":89
4435  *
4436  *
4437  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
4438  * """
4439  * function returning value=a0+ax*x+ay*y+az*z
4440  */
4441 
4442 /* Python wrapper */
4443 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4444 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC[] = "\n function returning value=a0+ax*x+ay*y+az*z\n\n Parameters\n ----------\n a0 : float\n constant\n a: numpy.ndarray\n ax,ay,az\n\n ";
4445 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC = {"setLinearBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC};
4446 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4447  PyObject *__pyx_v_a0 = 0;
4448  PyObject *__pyx_v_a = 0;
4449  PyObject *__pyx_r = 0;
4450  __Pyx_RefNannyDeclarations
4451  __Pyx_RefNannySetupContext("setLinearBC (wrapper)", 0);
4452  {
4453  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a0,&__pyx_n_s_a,0};
4454  PyObject* values[2] = {0,0};
4455  if (unlikely(__pyx_kwds)) {
4456  Py_ssize_t kw_args;
4457  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4458  switch (pos_args) {
4459  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4460  CYTHON_FALLTHROUGH;
4461  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4462  CYTHON_FALLTHROUGH;
4463  case 0: break;
4464  default: goto __pyx_L5_argtuple_error;
4465  }
4466  kw_args = PyDict_Size(__pyx_kwds);
4467  switch (pos_args) {
4468  case 0:
4469  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a0)) != 0)) kw_args--;
4470  else goto __pyx_L5_argtuple_error;
4471  CYTHON_FALLTHROUGH;
4472  case 1:
4473  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
4474  else {
4475  __Pyx_RaiseArgtupleInvalid("setLinearBC", 1, 2, 2, 1); __PYX_ERR(0, 89, __pyx_L3_error)
4476  }
4477  }
4478  if (unlikely(kw_args > 0)) {
4479  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLinearBC") < 0)) __PYX_ERR(0, 89, __pyx_L3_error)
4480  }
4481  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4482  goto __pyx_L5_argtuple_error;
4483  } else {
4484  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4485  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4486  }
4487  __pyx_v_a0 = values[0];
4488  __pyx_v_a = values[1];
4489  }
4490  goto __pyx_L4_argument_unpacking_done;
4491  __pyx_L5_argtuple_error:;
4492  __Pyx_RaiseArgtupleInvalid("setLinearBC", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 89, __pyx_L3_error)
4493  __pyx_L3_error:;
4494  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4495  __Pyx_RefNannyFinishContext();
4496  return NULL;
4497  __pyx_L4_argument_unpacking_done:;
4498  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_a0, __pyx_v_a);
4499 
4500  /* function exit code */
4501  __Pyx_RefNannyFinishContext();
4502  return __pyx_r;
4503 }
4504 
4505 /* "BoundaryConditions.py":102
4506  * """
4507  *
4508  * self.uOfXT = lambda x, t: a0+sum(a[:]*x[:]) # <<<<<<<<<<<<<<
4509  *
4510  * def setLinearRamp(self,t1,value):
4511  */
4512 
4513 /* Python wrapper */
4514 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4515 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1 = {"lambda1", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, METH_VARARGS|METH_KEYWORDS, 0};
4516 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4517  PyObject *__pyx_v_x = 0;
4518  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
4519  PyObject *__pyx_r = 0;
4520  __Pyx_RefNannyDeclarations
4521  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
4522  {
4523  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
4524  PyObject* values[2] = {0,0};
4525  if (unlikely(__pyx_kwds)) {
4526  Py_ssize_t kw_args;
4527  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4528  switch (pos_args) {
4529  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4530  CYTHON_FALLTHROUGH;
4531  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4532  CYTHON_FALLTHROUGH;
4533  case 0: break;
4534  default: goto __pyx_L5_argtuple_error;
4535  }
4536  kw_args = PyDict_Size(__pyx_kwds);
4537  switch (pos_args) {
4538  case 0:
4539  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4540  else goto __pyx_L5_argtuple_error;
4541  CYTHON_FALLTHROUGH;
4542  case 1:
4543  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4544  else {
4545  __Pyx_RaiseArgtupleInvalid("lambda1", 1, 2, 2, 1); __PYX_ERR(0, 102, __pyx_L3_error)
4546  }
4547  }
4548  if (unlikely(kw_args > 0)) {
4549  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda1") < 0)) __PYX_ERR(0, 102, __pyx_L3_error)
4550  }
4551  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4552  goto __pyx_L5_argtuple_error;
4553  } else {
4554  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4555  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4556  }
4557  __pyx_v_x = values[0];
4558  __pyx_v_t = values[1];
4559  }
4560  goto __pyx_L4_argument_unpacking_done;
4561  __pyx_L5_argtuple_error:;
4562  __Pyx_RaiseArgtupleInvalid("lambda1", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error)
4563  __pyx_L3_error:;
4564  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4565  __Pyx_RefNannyFinishContext();
4566  return NULL;
4567  __pyx_L4_argument_unpacking_done:;
4568  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x, __pyx_v_t);
4569 
4570  /* function exit code */
4571  __Pyx_RefNannyFinishContext();
4572  return __pyx_r;
4573 }
4574 
4575 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t) {
4576  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
4577  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_outer_scope;
4578  PyObject *__pyx_r = NULL;
4579  __Pyx_RefNannyDeclarations
4580  PyObject *__pyx_t_1 = NULL;
4581  PyObject *__pyx_t_2 = NULL;
4582  PyObject *__pyx_t_3 = NULL;
4583  __Pyx_RefNannySetupContext("lambda1", 0);
4584  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
4585  __pyx_cur_scope = __pyx_outer_scope;
4586  __Pyx_XDECREF(__pyx_r);
4587  if (unlikely(!__pyx_cur_scope->__pyx_v_a0)) { __Pyx_RaiseClosureNameError("a0"); __PYX_ERR(0, 102, __pyx_L1_error) }
4588  if (unlikely(!__pyx_cur_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); __PYX_ERR(0, 102, __pyx_L1_error) }
4589  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_a, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
4590  __Pyx_GOTREF(__pyx_t_1);
4591  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_x, 0, 0, NULL, NULL, &__pyx_slice__2, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
4592  __Pyx_GOTREF(__pyx_t_2);
4593  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error)
4594  __Pyx_GOTREF(__pyx_t_3);
4595  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4596  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4597  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
4598  __Pyx_GOTREF(__pyx_t_2);
4599  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4600  __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_a0, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error)
4601  __Pyx_GOTREF(__pyx_t_3);
4602  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4603  __pyx_r = __pyx_t_3;
4604  __pyx_t_3 = 0;
4605  goto __pyx_L0;
4606 
4607  /* function exit code */
4608  __pyx_L1_error:;
4609  __Pyx_XDECREF(__pyx_t_1);
4610  __Pyx_XDECREF(__pyx_t_2);
4611  __Pyx_XDECREF(__pyx_t_3);
4612  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4613  __pyx_r = NULL;
4614  __pyx_L0:;
4615  __Pyx_XGIVEREF(__pyx_r);
4616  __Pyx_RefNannyFinishContext();
4617  return __pyx_r;
4618 }
4619 
4620 /* "BoundaryConditions.py":89
4621  *
4622  *
4623  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
4624  * """
4625  * function returning value=a0+ax*x+ay*y+az*z
4626  */
4627 
4628 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a) {
4629  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
4630  PyObject *__pyx_r = NULL;
4631  __Pyx_RefNannyDeclarations
4632  PyObject *__pyx_t_1 = NULL;
4633  __Pyx_RefNannySetupContext("setLinearBC", 0);
4634  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, __pyx_empty_tuple, NULL);
4635  if (unlikely(!__pyx_cur_scope)) {
4636  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)Py_None);
4637  __Pyx_INCREF(Py_None);
4638  __PYX_ERR(0, 89, __pyx_L1_error)
4639  } else {
4640  __Pyx_GOTREF(__pyx_cur_scope);
4641  }
4642  __pyx_cur_scope->__pyx_v_a0 = __pyx_v_a0;
4643  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a0);
4644  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a0);
4645  __pyx_cur_scope->__pyx_v_a = __pyx_v_a;
4646  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a);
4647  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a);
4648 
4649  /* "BoundaryConditions.py":102
4650  * """
4651  *
4652  * self.uOfXT = lambda x, t: a0+sum(a[:]*x[:]) # <<<<<<<<<<<<<<
4653  *
4654  * def setLinearRamp(self,t1,value):
4655  */
4656  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, 0, __pyx_n_s_setLinearBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
4657  __Pyx_GOTREF(__pyx_t_1);
4658  __Pyx_GIVEREF(__pyx_t_1);
4659  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4660  __Pyx_DECREF(__pyx_v_self->uOfXT);
4661  __pyx_v_self->uOfXT = __pyx_t_1;
4662  __pyx_t_1 = 0;
4663 
4664  /* "BoundaryConditions.py":89
4665  *
4666  *
4667  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
4668  * """
4669  * function returning value=a0+ax*x+ay*y+az*z
4670  */
4671 
4672  /* function exit code */
4673  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4674  goto __pyx_L0;
4675  __pyx_L1_error:;
4676  __Pyx_XDECREF(__pyx_t_1);
4677  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4678  __pyx_r = NULL;
4679  __pyx_L0:;
4680  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4681  __Pyx_XGIVEREF(__pyx_r);
4682  __Pyx_RefNannyFinishContext();
4683  return __pyx_r;
4684 }
4685 
4686 /* "BoundaryConditions.py":104
4687  * self.uOfXT = lambda x, t: a0+sum(a[:]*x[:])
4688  *
4689  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
4690  * """
4691  * function setting a linear ramp from t=0 to t=t1
4692  */
4693 
4694 /* Python wrapper */
4695 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4696 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp[] = "\n function setting a linear ramp from t=0 to t=t1\n\n Parameters\n -----------\n t1: float\n Ramp end time\n value: float\n Variable value\n ";
4697 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp = {"setLinearRamp", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp};
4698 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4699  PyObject *__pyx_v_t1 = 0;
4700  PyObject *__pyx_v_value = 0;
4701  PyObject *__pyx_r = 0;
4702  __Pyx_RefNannyDeclarations
4703  __Pyx_RefNannySetupContext("setLinearRamp (wrapper)", 0);
4704  {
4705  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t1,&__pyx_n_s_value,0};
4706  PyObject* values[2] = {0,0};
4707  if (unlikely(__pyx_kwds)) {
4708  Py_ssize_t kw_args;
4709  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4710  switch (pos_args) {
4711  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4712  CYTHON_FALLTHROUGH;
4713  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4714  CYTHON_FALLTHROUGH;
4715  case 0: break;
4716  default: goto __pyx_L5_argtuple_error;
4717  }
4718  kw_args = PyDict_Size(__pyx_kwds);
4719  switch (pos_args) {
4720  case 0:
4721  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t1)) != 0)) kw_args--;
4722  else goto __pyx_L5_argtuple_error;
4723  CYTHON_FALLTHROUGH;
4724  case 1:
4725  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
4726  else {
4727  __Pyx_RaiseArgtupleInvalid("setLinearRamp", 1, 2, 2, 1); __PYX_ERR(0, 104, __pyx_L3_error)
4728  }
4729  }
4730  if (unlikely(kw_args > 0)) {
4731  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLinearRamp") < 0)) __PYX_ERR(0, 104, __pyx_L3_error)
4732  }
4733  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4734  goto __pyx_L5_argtuple_error;
4735  } else {
4736  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4737  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4738  }
4739  __pyx_v_t1 = values[0];
4740  __pyx_v_value = values[1];
4741  }
4742  goto __pyx_L4_argument_unpacking_done;
4743  __pyx_L5_argtuple_error:;
4744  __Pyx_RaiseArgtupleInvalid("setLinearRamp", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 104, __pyx_L3_error)
4745  __pyx_L3_error:;
4746  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
4747  __Pyx_RefNannyFinishContext();
4748  return NULL;
4749  __pyx_L4_argument_unpacking_done:;
4750  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_t1, __pyx_v_value);
4751 
4752  /* function exit code */
4753  __Pyx_RefNannyFinishContext();
4754  return __pyx_r;
4755 }
4756 
4757 /* "BoundaryConditions.py":115
4758  * Variable value
4759  * """
4760  * self.uOfXT = lambda x, t: min( t/t1, 1)*value # <<<<<<<<<<<<<<
4761  */
4762 
4763 /* Python wrapper */
4764 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4765 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2 = {"lambda2", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, METH_VARARGS|METH_KEYWORDS, 0};
4766 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4767  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
4768  PyObject *__pyx_v_t = 0;
4769  PyObject *__pyx_r = 0;
4770  __Pyx_RefNannyDeclarations
4771  __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
4772  {
4773  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
4774  PyObject* values[2] = {0,0};
4775  if (unlikely(__pyx_kwds)) {
4776  Py_ssize_t kw_args;
4777  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4778  switch (pos_args) {
4779  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4780  CYTHON_FALLTHROUGH;
4781  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4782  CYTHON_FALLTHROUGH;
4783  case 0: break;
4784  default: goto __pyx_L5_argtuple_error;
4785  }
4786  kw_args = PyDict_Size(__pyx_kwds);
4787  switch (pos_args) {
4788  case 0:
4789  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4790  else goto __pyx_L5_argtuple_error;
4791  CYTHON_FALLTHROUGH;
4792  case 1:
4793  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4794  else {
4795  __Pyx_RaiseArgtupleInvalid("lambda2", 1, 2, 2, 1); __PYX_ERR(0, 115, __pyx_L3_error)
4796  }
4797  }
4798  if (unlikely(kw_args > 0)) {
4799  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda2") < 0)) __PYX_ERR(0, 115, __pyx_L3_error)
4800  }
4801  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4802  goto __pyx_L5_argtuple_error;
4803  } else {
4804  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4805  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4806  }
4807  __pyx_v_x = values[0];
4808  __pyx_v_t = values[1];
4809  }
4810  goto __pyx_L4_argument_unpacking_done;
4811  __pyx_L5_argtuple_error:;
4812  __Pyx_RaiseArgtupleInvalid("lambda2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 115, __pyx_L3_error)
4813  __pyx_L3_error:;
4814  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4815  __Pyx_RefNannyFinishContext();
4816  return NULL;
4817  __pyx_L4_argument_unpacking_done:;
4818  __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, __pyx_v_x, __pyx_v_t);
4819 
4820  /* function exit code */
4821  __Pyx_RefNannyFinishContext();
4822  return __pyx_r;
4823 }
4824 
4825 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
4826  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
4827  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_outer_scope;
4828  PyObject *__pyx_r = NULL;
4829  __Pyx_RefNannyDeclarations
4830  long __pyx_t_1;
4831  PyObject *__pyx_t_2 = NULL;
4832  PyObject *__pyx_t_3 = NULL;
4833  PyObject *__pyx_t_4 = NULL;
4834  PyObject *__pyx_t_5 = NULL;
4835  int __pyx_t_6;
4836  __Pyx_RefNannySetupContext("lambda2", 0);
4837  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *) __Pyx_CyFunction_GetClosure(__pyx_self);
4838  __pyx_cur_scope = __pyx_outer_scope;
4839  __Pyx_XDECREF(__pyx_r);
4840  __pyx_t_1 = 1;
4841  if (unlikely(!__pyx_cur_scope->__pyx_v_t1)) { __Pyx_RaiseClosureNameError("t1"); __PYX_ERR(0, 115, __pyx_L1_error) }
4842  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_t, __pyx_cur_scope->__pyx_v_t1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
4843  __Pyx_GOTREF(__pyx_t_2);
4844  __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error)
4845  __Pyx_GOTREF(__pyx_t_4);
4846  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error)
4847  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4848  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 115, __pyx_L1_error)
4849  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4850  if (__pyx_t_6) {
4851  __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error)
4852  __Pyx_GOTREF(__pyx_t_5);
4853  __pyx_t_3 = __pyx_t_5;
4854  __pyx_t_5 = 0;
4855  } else {
4856  __Pyx_INCREF(__pyx_t_2);
4857  __pyx_t_3 = __pyx_t_2;
4858  }
4859  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4860  if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 115, __pyx_L1_error) }
4861  __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_cur_scope->__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
4862  __Pyx_GOTREF(__pyx_t_2);
4863  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4864  __pyx_r = __pyx_t_2;
4865  __pyx_t_2 = 0;
4866  goto __pyx_L0;
4867 
4868  /* function exit code */
4869  __pyx_L1_error:;
4870  __Pyx_XDECREF(__pyx_t_2);
4871  __Pyx_XDECREF(__pyx_t_3);
4872  __Pyx_XDECREF(__pyx_t_4);
4873  __Pyx_XDECREF(__pyx_t_5);
4874  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4875  __pyx_r = NULL;
4876  __pyx_L0:;
4877  __Pyx_XGIVEREF(__pyx_r);
4878  __Pyx_RefNannyFinishContext();
4879  return __pyx_r;
4880 }
4881 
4882 /* "BoundaryConditions.py":104
4883  * self.uOfXT = lambda x, t: a0+sum(a[:]*x[:])
4884  *
4885  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
4886  * """
4887  * function setting a linear ramp from t=0 to t=t1
4888  */
4889 
4890 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value) {
4891  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
4892  PyObject *__pyx_r = NULL;
4893  __Pyx_RefNannyDeclarations
4894  PyObject *__pyx_t_1 = NULL;
4895  __Pyx_RefNannySetupContext("setLinearRamp", 0);
4896  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, __pyx_empty_tuple, NULL);
4897  if (unlikely(!__pyx_cur_scope)) {
4898  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)Py_None);
4899  __Pyx_INCREF(Py_None);
4900  __PYX_ERR(0, 104, __pyx_L1_error)
4901  } else {
4902  __Pyx_GOTREF(__pyx_cur_scope);
4903  }
4904  __pyx_cur_scope->__pyx_v_t1 = __pyx_v_t1;
4905  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t1);
4906  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t1);
4907  __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
4908  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4909  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
4910 
4911  /* "BoundaryConditions.py":115
4912  * Variable value
4913  * """
4914  * self.uOfXT = lambda x, t: min( t/t1, 1)*value # <<<<<<<<<<<<<<
4915  */
4916  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, 0, __pyx_n_s_setLinearRamp_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
4917  __Pyx_GOTREF(__pyx_t_1);
4918  __Pyx_GIVEREF(__pyx_t_1);
4919  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4920  __Pyx_DECREF(__pyx_v_self->uOfXT);
4921  __pyx_v_self->uOfXT = __pyx_t_1;
4922  __pyx_t_1 = 0;
4923 
4924  /* "BoundaryConditions.py":104
4925  * self.uOfXT = lambda x, t: a0+sum(a[:]*x[:])
4926  *
4927  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
4928  * """
4929  * function setting a linear ramp from t=0 to t=t1
4930  */
4931 
4932  /* function exit code */
4933  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4934  goto __pyx_L0;
4935  __pyx_L1_error:;
4936  __Pyx_XDECREF(__pyx_t_1);
4937  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
4938  __pyx_r = NULL;
4939  __pyx_L0:;
4940  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4941  __Pyx_XGIVEREF(__pyx_r);
4942  __Pyx_RefNannyFinishContext();
4943  return __pyx_r;
4944 }
4945 
4946 /* "BoundaryConditions.pxd":20
4947  * cdef cpp_uOfXT uuOfXT
4948  * cdef public:
4949  * object uOfXT # <<<<<<<<<<<<<<
4950  * cpdef void resetBC(self)
4951  * # cpdef void setConstantBC(self, double value)
4952  */
4953 
4954 /* Python wrapper */
4955 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self); /*proto*/
4956 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self) {
4957  PyObject *__pyx_r = 0;
4958  __Pyx_RefNannyDeclarations
4959  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4960  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4961 
4962  /* function exit code */
4963  __Pyx_RefNannyFinishContext();
4964  return __pyx_r;
4965 }
4966 
4967 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4968  PyObject *__pyx_r = NULL;
4969  __Pyx_RefNannyDeclarations
4970  __Pyx_RefNannySetupContext("__get__", 0);
4971  __Pyx_XDECREF(__pyx_r);
4972  __Pyx_INCREF(__pyx_v_self->uOfXT);
4973  __pyx_r = __pyx_v_self->uOfXT;
4974  goto __pyx_L0;
4975 
4976  /* function exit code */
4977  __pyx_L0:;
4978  __Pyx_XGIVEREF(__pyx_r);
4979  __Pyx_RefNannyFinishContext();
4980  return __pyx_r;
4981 }
4982 
4983 /* Python wrapper */
4984 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
4985 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4986  int __pyx_r;
4987  __Pyx_RefNannyDeclarations
4988  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4989  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4990 
4991  /* function exit code */
4992  __Pyx_RefNannyFinishContext();
4993  return __pyx_r;
4994 }
4995 
4996 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
4997  int __pyx_r;
4998  __Pyx_RefNannyDeclarations
4999  __Pyx_RefNannySetupContext("__set__", 0);
5000  __Pyx_INCREF(__pyx_v_value);
5001  __Pyx_GIVEREF(__pyx_v_value);
5002  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5003  __Pyx_DECREF(__pyx_v_self->uOfXT);
5004  __pyx_v_self->uOfXT = __pyx_v_value;
5005 
5006  /* function exit code */
5007  __pyx_r = 0;
5008  __Pyx_RefNannyFinishContext();
5009  return __pyx_r;
5010 }
5011 
5012 /* Python wrapper */
5013 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self); /*proto*/
5014 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self) {
5015  int __pyx_r;
5016  __Pyx_RefNannyDeclarations
5017  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
5018  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5019 
5020  /* function exit code */
5021  __Pyx_RefNannyFinishContext();
5022  return __pyx_r;
5023 }
5024 
5025 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5026  int __pyx_r;
5027  __Pyx_RefNannyDeclarations
5028  __Pyx_RefNannySetupContext("__del__", 0);
5029  __Pyx_INCREF(Py_None);
5030  __Pyx_GIVEREF(Py_None);
5031  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5032  __Pyx_DECREF(__pyx_v_self->uOfXT);
5033  __pyx_v_self->uOfXT = Py_None;
5034 
5035  /* function exit code */
5036  __pyx_r = 0;
5037  __Pyx_RefNannyFinishContext();
5038  return __pyx_r;
5039 }
5040 
5041 /* "(tree fragment)":1
5042  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5043  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5044  * def __setstate_cython__(self, __pyx_state):
5045  */
5046 
5047 /* Python wrapper */
5048 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5049 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, 0};
5050 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5051  PyObject *__pyx_r = 0;
5052  __Pyx_RefNannyDeclarations
5053  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5054  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5055 
5056  /* function exit code */
5057  __Pyx_RefNannyFinishContext();
5058  return __pyx_r;
5059 }
5060 
5061 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5062  PyObject *__pyx_r = NULL;
5063  __Pyx_RefNannyDeclarations
5064  PyObject *__pyx_t_1 = NULL;
5065  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5066 
5067  /* "(tree fragment)":2
5068  * def __reduce_cython__(self):
5069  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
5070  * def __setstate_cython__(self, __pyx_state):
5071  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5072  */
5073  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5074  __Pyx_GOTREF(__pyx_t_1);
5075  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5076  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5077  __PYX_ERR(1, 2, __pyx_L1_error)
5078 
5079  /* "(tree fragment)":1
5080  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5081  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5082  * def __setstate_cython__(self, __pyx_state):
5083  */
5084 
5085  /* function exit code */
5086  __pyx_L1_error:;
5087  __Pyx_XDECREF(__pyx_t_1);
5088  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5089  __pyx_r = NULL;
5090  __Pyx_XGIVEREF(__pyx_r);
5091  __Pyx_RefNannyFinishContext();
5092  return __pyx_r;
5093 }
5094 
5095 /* "(tree fragment)":3
5096  * def __reduce_cython__(self):
5097  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5098  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5099  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5100  */
5101 
5102 /* Python wrapper */
5103 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
5104 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, 0};
5105 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5106  PyObject *__pyx_r = 0;
5107  __Pyx_RefNannyDeclarations
5108  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5109  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5110 
5111  /* function exit code */
5112  __Pyx_RefNannyFinishContext();
5113  return __pyx_r;
5114 }
5115 
5116 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5117  PyObject *__pyx_r = NULL;
5118  __Pyx_RefNannyDeclarations
5119  PyObject *__pyx_t_1 = NULL;
5120  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5121 
5122  /* "(tree fragment)":4
5123  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5124  * def __setstate_cython__(self, __pyx_state):
5125  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
5126  */
5127  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
5128  __Pyx_GOTREF(__pyx_t_1);
5129  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5130  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5131  __PYX_ERR(1, 4, __pyx_L1_error)
5132 
5133  /* "(tree fragment)":3
5134  * def __reduce_cython__(self):
5135  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5136  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5137  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5138  */
5139 
5140  /* function exit code */
5141  __pyx_L1_error:;
5142  __Pyx_XDECREF(__pyx_t_1);
5143  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5144  __pyx_r = NULL;
5145  __Pyx_XGIVEREF(__pyx_r);
5146  __Pyx_RefNannyFinishContext();
5147  return __pyx_r;
5148 }
5149 
5150 /* "(tree fragment)":1
5151  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
5152  * if __pyx_checksum != 0x96e6a1f:
5153  * from pickle import PickleError as __pyx_PickleError
5154  */
5155 
5156 /* Python wrapper */
5157 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5158 static PyMethodDef __pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base = {"__pyx_unpickle_BC_Base", (PyCFunction)__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base, METH_VARARGS|METH_KEYWORDS, 0};
5159 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5160  PyObject *__pyx_v___pyx_type = 0;
5161  long __pyx_v___pyx_checksum;
5162  PyObject *__pyx_v___pyx_state = 0;
5163  PyObject *__pyx_r = 0;
5164  __Pyx_RefNannyDeclarations
5165  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base (wrapper)", 0);
5166  {
5167  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
5168  PyObject* values[3] = {0,0,0};
5169  if (unlikely(__pyx_kwds)) {
5170  Py_ssize_t kw_args;
5171  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5172  switch (pos_args) {
5173  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5174  CYTHON_FALLTHROUGH;
5175  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5176  CYTHON_FALLTHROUGH;
5177  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5178  CYTHON_FALLTHROUGH;
5179  case 0: break;
5180  default: goto __pyx_L5_argtuple_error;
5181  }
5182  kw_args = PyDict_Size(__pyx_kwds);
5183  switch (pos_args) {
5184  case 0:
5185  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
5186  else goto __pyx_L5_argtuple_error;
5187  CYTHON_FALLTHROUGH;
5188  case 1:
5189  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
5190  else {
5191  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
5192  }
5193  CYTHON_FALLTHROUGH;
5194  case 2:
5195  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
5196  else {
5197  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
5198  }
5199  }
5200  if (unlikely(kw_args > 0)) {
5201  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_BC_Base") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
5202  }
5203  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5204  goto __pyx_L5_argtuple_error;
5205  } else {
5206  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5207  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5208  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5209  }
5210  __pyx_v___pyx_type = values[0];
5211  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
5212  __pyx_v___pyx_state = values[2];
5213  }
5214  goto __pyx_L4_argument_unpacking_done;
5215  __pyx_L5_argtuple_error:;
5216  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
5217  __pyx_L3_error:;
5218  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
5219  __Pyx_RefNannyFinishContext();
5220  return NULL;
5221  __pyx_L4_argument_unpacking_done:;
5222  __pyx_r = __pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
5223 
5224  /* function exit code */
5225  __Pyx_RefNannyFinishContext();
5226  return __pyx_r;
5227 }
5228 
5229 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
5230  PyObject *__pyx_v___pyx_PickleError = NULL;
5231  PyObject *__pyx_v___pyx_result = NULL;
5232  PyObject *__pyx_r = NULL;
5233  __Pyx_RefNannyDeclarations
5234  int __pyx_t_1;
5235  PyObject *__pyx_t_2 = NULL;
5236  PyObject *__pyx_t_3 = NULL;
5237  PyObject *__pyx_t_4 = NULL;
5238  PyObject *__pyx_t_5 = NULL;
5239  PyObject *__pyx_t_6 = NULL;
5240  int __pyx_t_7;
5241  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base", 0);
5242 
5243  /* "(tree fragment)":2
5244  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state):
5245  * if __pyx_checksum != 0x96e6a1f: # <<<<<<<<<<<<<<
5246  * from pickle import PickleError as __pyx_PickleError
5247  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
5248  */
5249  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x96e6a1f) != 0);
5250  if (__pyx_t_1) {
5251 
5252  /* "(tree fragment)":3
5253  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state):
5254  * if __pyx_checksum != 0x96e6a1f:
5255  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
5256  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
5257  * __pyx_result = BC_Base.__new__(__pyx_type)
5258  */
5259  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
5260  __Pyx_GOTREF(__pyx_t_2);
5261  __Pyx_INCREF(__pyx_n_s_PickleError);
5262  __Pyx_GIVEREF(__pyx_n_s_PickleError);
5263  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
5264  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
5265  __Pyx_GOTREF(__pyx_t_3);
5266  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5267  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
5268  __Pyx_GOTREF(__pyx_t_2);
5269  __Pyx_INCREF(__pyx_t_2);
5270  __pyx_v___pyx_PickleError = __pyx_t_2;
5271  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5272  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5273 
5274  /* "(tree fragment)":4
5275  * if __pyx_checksum != 0x96e6a1f:
5276  * from pickle import PickleError as __pyx_PickleError
5277  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum) # <<<<<<<<<<<<<<
5278  * __pyx_result = BC_Base.__new__(__pyx_type)
5279  * if __pyx_state is not None:
5280  */
5281  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error)
5282  __Pyx_GOTREF(__pyx_t_2);
5283  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
5284  __Pyx_GOTREF(__pyx_t_4);
5285  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5286  __Pyx_INCREF(__pyx_v___pyx_PickleError);
5287  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
5288  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
5289  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
5290  if (likely(__pyx_t_5)) {
5291  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5292  __Pyx_INCREF(__pyx_t_5);
5293  __Pyx_INCREF(function);
5294  __Pyx_DECREF_SET(__pyx_t_2, function);
5295  }
5296  }
5297  if (!__pyx_t_5) {
5298  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
5299  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5300  __Pyx_GOTREF(__pyx_t_3);
5301  } else {
5302  #if CYTHON_FAST_PYCALL
5303  if (PyFunction_Check(__pyx_t_2)) {
5304  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
5305  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
5306  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5307  __Pyx_GOTREF(__pyx_t_3);
5308  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5309  } else
5310  #endif
5311  #if CYTHON_FAST_PYCCALL
5312  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
5313  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
5314  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
5315  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5316  __Pyx_GOTREF(__pyx_t_3);
5317  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5318  } else
5319  #endif
5320  {
5321  __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4, __pyx_L1_error)
5322  __Pyx_GOTREF(__pyx_t_6);
5323  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
5324  __Pyx_GIVEREF(__pyx_t_4);
5325  PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
5326  __pyx_t_4 = 0;
5327  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
5328  __Pyx_GOTREF(__pyx_t_3);
5329  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5330  }
5331  }
5332  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5333  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5334  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5335  __PYX_ERR(1, 4, __pyx_L1_error)
5336 
5337  /* "(tree fragment)":2
5338  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state):
5339  * if __pyx_checksum != 0x96e6a1f: # <<<<<<<<<<<<<<
5340  * from pickle import PickleError as __pyx_PickleError
5341  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
5342  */
5343  }
5344 
5345  /* "(tree fragment)":5
5346  * from pickle import PickleError as __pyx_PickleError
5347  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
5348  * __pyx_result = BC_Base.__new__(__pyx_type) # <<<<<<<<<<<<<<
5349  * if __pyx_state is not None:
5350  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
5351  */
5352  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
5353  __Pyx_GOTREF(__pyx_t_2);
5354  __pyx_t_6 = NULL;
5355  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5356  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
5357  if (likely(__pyx_t_6)) {
5358  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5359  __Pyx_INCREF(__pyx_t_6);
5360  __Pyx_INCREF(function);
5361  __Pyx_DECREF_SET(__pyx_t_2, function);
5362  }
5363  }
5364  if (!__pyx_t_6) {
5365  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
5366  __Pyx_GOTREF(__pyx_t_3);
5367  } else {
5368  #if CYTHON_FAST_PYCALL
5369  if (PyFunction_Check(__pyx_t_2)) {
5370  PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
5371  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
5372  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5373  __Pyx_GOTREF(__pyx_t_3);
5374  } else
5375  #endif
5376  #if CYTHON_FAST_PYCCALL
5377  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
5378  PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
5379  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
5380  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5381  __Pyx_GOTREF(__pyx_t_3);
5382  } else
5383  #endif
5384  {
5385  __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
5386  __Pyx_GOTREF(__pyx_t_4);
5387  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
5388  __Pyx_INCREF(__pyx_v___pyx_type);
5389  __Pyx_GIVEREF(__pyx_v___pyx_type);
5390  PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
5391  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
5392  __Pyx_GOTREF(__pyx_t_3);
5393  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5394  }
5395  }
5396  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5397  __pyx_v___pyx_result = __pyx_t_3;
5398  __pyx_t_3 = 0;
5399 
5400  /* "(tree fragment)":6
5401  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
5402  * __pyx_result = BC_Base.__new__(__pyx_type)
5403  * if __pyx_state is not None: # <<<<<<<<<<<<<<
5404  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
5405  * return __pyx_result
5406  */
5407  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
5408  __pyx_t_7 = (__pyx_t_1 != 0);
5409  if (__pyx_t_7) {
5410 
5411  /* "(tree fragment)":7
5412  * __pyx_result = BC_Base.__new__(__pyx_type)
5413  * if __pyx_state is not None:
5414  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
5415  * return __pyx_result
5416  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
5417  */
5418  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 7, __pyx_L1_error)
5419  __pyx_t_3 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
5420  __Pyx_GOTREF(__pyx_t_3);
5421  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5422 
5423  /* "(tree fragment)":6
5424  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
5425  * __pyx_result = BC_Base.__new__(__pyx_type)
5426  * if __pyx_state is not None: # <<<<<<<<<<<<<<
5427  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
5428  * return __pyx_result
5429  */
5430  }
5431 
5432  /* "(tree fragment)":8
5433  * if __pyx_state is not None:
5434  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
5435  * return __pyx_result # <<<<<<<<<<<<<<
5436  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
5437  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
5438  */
5439  __Pyx_XDECREF(__pyx_r);
5440  __Pyx_INCREF(__pyx_v___pyx_result);
5441  __pyx_r = __pyx_v___pyx_result;
5442  goto __pyx_L0;
5443 
5444  /* "(tree fragment)":1
5445  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
5446  * if __pyx_checksum != 0x96e6a1f:
5447  * from pickle import PickleError as __pyx_PickleError
5448  */
5449 
5450  /* function exit code */
5451  __pyx_L1_error:;
5452  __Pyx_XDECREF(__pyx_t_2);
5453  __Pyx_XDECREF(__pyx_t_3);
5454  __Pyx_XDECREF(__pyx_t_4);
5455  __Pyx_XDECREF(__pyx_t_5);
5456  __Pyx_XDECREF(__pyx_t_6);
5457  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
5458  __pyx_r = NULL;
5459  __pyx_L0:;
5460  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
5461  __Pyx_XDECREF(__pyx_v___pyx_result);
5462  __Pyx_XGIVEREF(__pyx_r);
5463  __Pyx_RefNannyFinishContext();
5464  return __pyx_r;
5465 }
5466 
5467 /* "(tree fragment)":9
5468  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
5469  * return __pyx_result
5470  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
5471  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
5472  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
5473  */
5474 
5475 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
5476  PyObject *__pyx_r = NULL;
5477  __Pyx_RefNannyDeclarations
5478  PyObject *__pyx_t_1 = NULL;
5479  __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5480  int __pyx_t_3;
5481  int __pyx_t_4;
5482  Py_ssize_t __pyx_t_5;
5483  int __pyx_t_6;
5484  int __pyx_t_7;
5485  PyObject *__pyx_t_8 = NULL;
5486  PyObject *__pyx_t_9 = NULL;
5487  PyObject *__pyx_t_10 = NULL;
5488  PyObject *__pyx_t_11 = NULL;
5489  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base__set_state", 0);
5490 
5491  /* "(tree fragment)":10
5492  * return __pyx_result
5493  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
5494  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5] # <<<<<<<<<<<<<<
5495  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
5496  * __pyx_result.__dict__.update(__pyx_state[6])
5497  */
5498  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5499  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5500  __PYX_ERR(1, 10, __pyx_L1_error)
5501  }
5502  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
5503  __Pyx_GOTREF(__pyx_t_1);
5504  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 10, __pyx_L1_error)
5505  __Pyx_GIVEREF(__pyx_t_1);
5506  __Pyx_GOTREF(__pyx_v___pyx_result->BC_type);
5507  __Pyx_DECREF(__pyx_v___pyx_result->BC_type);
5508  __pyx_v___pyx_result->BC_type = ((PyObject*)__pyx_t_1);
5509  __pyx_t_1 = 0;
5510  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5511  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5512  __PYX_ERR(1, 10, __pyx_L1_error)
5513  }
5514  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
5515  __Pyx_GOTREF(__pyx_t_1);
5516  __Pyx_GIVEREF(__pyx_t_1);
5517  __Pyx_GOTREF(__pyx_v___pyx_result->Shape);
5518  __Pyx_DECREF(__pyx_v___pyx_result->Shape);
5519  __pyx_v___pyx_result->Shape = __pyx_t_1;
5520  __pyx_t_1 = 0;
5521  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5522  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5523  __PYX_ERR(1, 10, __pyx_L1_error)
5524  }
5525  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
5526  __Pyx_GOTREF(__pyx_t_1);
5527  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 10, __pyx_L1_error)
5528  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5529  __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_b_or, 0);
5530  __pyx_v___pyx_result->_b_or = __pyx_t_2;
5531  __pyx_t_2.memview = NULL;
5532  __pyx_t_2.data = NULL;
5533  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5534  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5535  __PYX_ERR(1, 10, __pyx_L1_error)
5536  }
5537  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
5538  __Pyx_GOTREF(__pyx_t_1);
5539  __Pyx_GIVEREF(__pyx_t_1);
5540  __Pyx_GOTREF(__pyx_v___pyx_result->ct);
5541  __Pyx_DECREF(__pyx_v___pyx_result->ct);
5542  __pyx_v___pyx_result->ct = __pyx_t_1;
5543  __pyx_t_1 = 0;
5544  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5545  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5546  __PYX_ERR(1, 10, __pyx_L1_error)
5547  }
5548  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
5549  __Pyx_GOTREF(__pyx_t_1);
5550  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 10, __pyx_L1_error)
5551  __Pyx_GIVEREF(__pyx_t_1);
5552  __Pyx_GOTREF(__pyx_v___pyx_result->name);
5553  __Pyx_DECREF(__pyx_v___pyx_result->name);
5554  __pyx_v___pyx_result->name = ((PyObject*)__pyx_t_1);
5555  __pyx_t_1 = 0;
5556  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5557  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5558  __PYX_ERR(1, 10, __pyx_L1_error)
5559  }
5560  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
5561  __Pyx_GOTREF(__pyx_t_1);
5562  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error)
5563  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5564  __pyx_v___pyx_result->nd = __pyx_t_3;
5565 
5566  /* "(tree fragment)":11
5567  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
5568  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
5569  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
5570  * __pyx_result.__dict__.update(__pyx_state[6])
5571  */
5572  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5573  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
5574  __PYX_ERR(1, 11, __pyx_L1_error)
5575  }
5576  __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
5577  __pyx_t_6 = ((__pyx_t_5 > 6) != 0);
5578  if (__pyx_t_6) {
5579  } else {
5580  __pyx_t_4 = __pyx_t_6;
5581  goto __pyx_L4_bool_binop_done;
5582  }
5583  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
5584  __pyx_t_7 = (__pyx_t_6 != 0);
5585  __pyx_t_4 = __pyx_t_7;
5586  __pyx_L4_bool_binop_done:;
5587  if (__pyx_t_4) {
5588 
5589  /* "(tree fragment)":12
5590  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
5591  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
5592  * __pyx_result.__dict__.update(__pyx_state[6]) # <<<<<<<<<<<<<<
5593  */
5594  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 12, __pyx_L1_error)
5595  __Pyx_GOTREF(__pyx_t_8);
5596  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 12, __pyx_L1_error)
5597  __Pyx_GOTREF(__pyx_t_9);
5598  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5599  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5600  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5601  __PYX_ERR(1, 12, __pyx_L1_error)
5602  }
5603  __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 12, __pyx_L1_error)
5604  __Pyx_GOTREF(__pyx_t_8);
5605  __pyx_t_10 = NULL;
5606  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
5607  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
5608  if (likely(__pyx_t_10)) {
5609  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
5610  __Pyx_INCREF(__pyx_t_10);
5611  __Pyx_INCREF(function);
5612  __Pyx_DECREF_SET(__pyx_t_9, function);
5613  }
5614  }
5615  if (!__pyx_t_10) {
5616  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
5617  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5618  __Pyx_GOTREF(__pyx_t_1);
5619  } else {
5620  #if CYTHON_FAST_PYCALL
5621  if (PyFunction_Check(__pyx_t_9)) {
5622  PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8};
5623  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
5624  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5625  __Pyx_GOTREF(__pyx_t_1);
5626  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5627  } else
5628  #endif
5629  #if CYTHON_FAST_PYCCALL
5630  if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
5631  PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8};
5632  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
5633  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5634  __Pyx_GOTREF(__pyx_t_1);
5635  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5636  } else
5637  #endif
5638  {
5639  __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 12, __pyx_L1_error)
5640  __Pyx_GOTREF(__pyx_t_11);
5641  __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
5642  __Pyx_GIVEREF(__pyx_t_8);
5643  PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_8);
5644  __pyx_t_8 = 0;
5645  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
5646  __Pyx_GOTREF(__pyx_t_1);
5647  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5648  }
5649  }
5650  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5651  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5652 
5653  /* "(tree fragment)":11
5654  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
5655  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
5656  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
5657  * __pyx_result.__dict__.update(__pyx_state[6])
5658  */
5659  }
5660 
5661  /* "(tree fragment)":9
5662  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
5663  * return __pyx_result
5664  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
5665  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
5666  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
5667  */
5668 
5669  /* function exit code */
5670  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5671  goto __pyx_L0;
5672  __pyx_L1_error:;
5673  __Pyx_XDECREF(__pyx_t_1);
5674  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5675  __Pyx_XDECREF(__pyx_t_8);
5676  __Pyx_XDECREF(__pyx_t_9);
5677  __Pyx_XDECREF(__pyx_t_10);
5678  __Pyx_XDECREF(__pyx_t_11);
5679  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
5680  __pyx_r = 0;
5681  __pyx_L0:;
5682  __Pyx_XGIVEREF(__pyx_r);
5683  __Pyx_RefNannyFinishContext();
5684  return __pyx_r;
5685 }
5686 
5687 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
5688  * # experimental exception made for __getbuffer__ and __releasebuffer__
5689  * # -- the details of this may change.
5690  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
5691  * # This implementation of getbuffer is geared towards Cython
5692  * # requirements, and does not yet fulfill the PEP.
5693  */
5694 
5695 /* Python wrapper */
5696 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
5697 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5698  int __pyx_r;
5699  __Pyx_RefNannyDeclarations
5700  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
5701  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
5702 
5703  /* function exit code */
5704  __Pyx_RefNannyFinishContext();
5705  return __pyx_r;
5706 }
5707 
5708 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5709  int __pyx_v_i;
5710  int __pyx_v_ndim;
5711  int __pyx_v_endian_detector;
5712  int __pyx_v_little_endian;
5713  int __pyx_v_t;
5714  char *__pyx_v_f;
5715  PyArray_Descr *__pyx_v_descr = 0;
5716  int __pyx_v_offset;
5717  int __pyx_r;
5718  __Pyx_RefNannyDeclarations
5719  int __pyx_t_1;
5720  int __pyx_t_2;
5721  PyObject *__pyx_t_3 = NULL;
5722  int __pyx_t_4;
5723  int __pyx_t_5;
5724  int __pyx_t_6;
5725  PyObject *__pyx_t_7 = NULL;
5726  char *__pyx_t_8;
5727  if (__pyx_v_info == NULL) {
5728  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
5729  return -1;
5730  }
5731  __Pyx_RefNannySetupContext("__getbuffer__", 0);
5732  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5733  __Pyx_GIVEREF(__pyx_v_info->obj);
5734 
5735  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
5736  *
5737  * cdef int i, ndim
5738  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
5739  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
5740  *
5741  */
5742  __pyx_v_endian_detector = 1;
5743 
5744  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223
5745  * cdef int i, ndim
5746  * cdef int endian_detector = 1
5747  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
5748  *
5749  * ndim = PyArray_NDIM(self)
5750  */
5751  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
5752 
5753  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225
5754  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
5755  *
5756  * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
5757  *
5758  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
5759  */
5760  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
5761 
5762  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
5763  * ndim = PyArray_NDIM(self)
5764  *
5765  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
5766  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
5767  * raise ValueError(u"ndarray is not C contiguous")
5768  */
5769  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
5770  if (__pyx_t_2) {
5771  } else {
5772  __pyx_t_1 = __pyx_t_2;
5773  goto __pyx_L4_bool_binop_done;
5774  }
5775 
5776  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228
5777  *
5778  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
5779  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
5780  * raise ValueError(u"ndarray is not C contiguous")
5781  *
5782  */
5783  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
5784  __pyx_t_1 = __pyx_t_2;
5785  __pyx_L4_bool_binop_done:;
5786 
5787  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
5788  * ndim = PyArray_NDIM(self)
5789  *
5790  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
5791  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
5792  * raise ValueError(u"ndarray is not C contiguous")
5793  */
5794  if (unlikely(__pyx_t_1)) {
5795 
5796  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
5797  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
5798  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
5799  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
5800  *
5801  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
5802  */
5803  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 229, __pyx_L1_error)
5804  __Pyx_GOTREF(__pyx_t_3);
5805  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5806  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5807  __PYX_ERR(3, 229, __pyx_L1_error)
5808 
5809  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
5810  * ndim = PyArray_NDIM(self)
5811  *
5812  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
5813  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
5814  * raise ValueError(u"ndarray is not C contiguous")
5815  */
5816  }
5817 
5818  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
5819  * raise ValueError(u"ndarray is not C contiguous")
5820  *
5821  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
5822  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
5823  * raise ValueError(u"ndarray is not Fortran contiguous")
5824  */
5825  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
5826  if (__pyx_t_2) {
5827  } else {
5828  __pyx_t_1 = __pyx_t_2;
5829  goto __pyx_L7_bool_binop_done;
5830  }
5831 
5832  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
5833  *
5834  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
5835  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
5836  * raise ValueError(u"ndarray is not Fortran contiguous")
5837  *
5838  */
5839  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
5840  __pyx_t_1 = __pyx_t_2;
5841  __pyx_L7_bool_binop_done:;
5842 
5843  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
5844  * raise ValueError(u"ndarray is not C contiguous")
5845  *
5846  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
5847  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
5848  * raise ValueError(u"ndarray is not Fortran contiguous")
5849  */
5850  if (unlikely(__pyx_t_1)) {
5851 
5852  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
5853  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
5854  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
5855  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
5856  *
5857  * info.buf = PyArray_DATA(self)
5858  */
5859  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 233, __pyx_L1_error)
5860  __Pyx_GOTREF(__pyx_t_3);
5861  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5862  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5863  __PYX_ERR(3, 233, __pyx_L1_error)
5864 
5865  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
5866  * raise ValueError(u"ndarray is not C contiguous")
5867  *
5868  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
5869  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
5870  * raise ValueError(u"ndarray is not Fortran contiguous")
5871  */
5872  }
5873 
5874  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
5875  * raise ValueError(u"ndarray is not Fortran contiguous")
5876  *
5877  * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
5878  * info.ndim = ndim
5879  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
5880  */
5881  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
5882 
5883  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
5884  *
5885  * info.buf = PyArray_DATA(self)
5886  * info.ndim = ndim # <<<<<<<<<<<<<<
5887  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
5888  * # Allocate new buffer for strides and shape info.
5889  */
5890  __pyx_v_info->ndim = __pyx_v_ndim;
5891 
5892  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237
5893  * info.buf = PyArray_DATA(self)
5894  * info.ndim = ndim
5895  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
5896  * # Allocate new buffer for strides and shape info.
5897  * # This is allocated as one block, strides first.
5898  */
5899  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
5900  if (__pyx_t_1) {
5901 
5902  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240
5903  * # Allocate new buffer for strides and shape info.
5904  * # This is allocated as one block, strides first.
5905  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
5906  * info.shape = info.strides + ndim
5907  * for i in range(ndim):
5908  */
5909  __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
5910 
5911  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":241
5912  * # This is allocated as one block, strides first.
5913  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
5914  * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
5915  * for i in range(ndim):
5916  * info.strides[i] = PyArray_STRIDES(self)[i]
5917  */
5918  __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
5919 
5920  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242
5921  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
5922  * info.shape = info.strides + ndim
5923  * for i in range(ndim): # <<<<<<<<<<<<<<
5924  * info.strides[i] = PyArray_STRIDES(self)[i]
5925  * info.shape[i] = PyArray_DIMS(self)[i]
5926  */
5927  __pyx_t_4 = __pyx_v_ndim;
5928  __pyx_t_5 = __pyx_t_4;
5929  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
5930  __pyx_v_i = __pyx_t_6;
5931 
5932  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243
5933  * info.shape = info.strides + ndim
5934  * for i in range(ndim):
5935  * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
5936  * info.shape[i] = PyArray_DIMS(self)[i]
5937  * else:
5938  */
5939  (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
5940 
5941  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244
5942  * for i in range(ndim):
5943  * info.strides[i] = PyArray_STRIDES(self)[i]
5944  * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
5945  * else:
5946  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
5947  */
5948  (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
5949  }
5950 
5951  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237
5952  * info.buf = PyArray_DATA(self)
5953  * info.ndim = ndim
5954  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
5955  * # Allocate new buffer for strides and shape info.
5956  * # This is allocated as one block, strides first.
5957  */
5958  goto __pyx_L9;
5959  }
5960 
5961  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
5962  * info.shape[i] = PyArray_DIMS(self)[i]
5963  * else:
5964  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
5965  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
5966  * info.suboffsets = NULL
5967  */
5968  /*else*/ {
5969  __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
5970 
5971  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":247
5972  * else:
5973  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
5974  * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
5975  * info.suboffsets = NULL
5976  * info.itemsize = PyArray_ITEMSIZE(self)
5977  */
5978  __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
5979  }
5980  __pyx_L9:;
5981 
5982  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
5983  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
5984  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
5985  * info.suboffsets = NULL # <<<<<<<<<<<<<<
5986  * info.itemsize = PyArray_ITEMSIZE(self)
5987  * info.readonly = not PyArray_ISWRITEABLE(self)
5988  */
5989  __pyx_v_info->suboffsets = NULL;
5990 
5991  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":249
5992  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
5993  * info.suboffsets = NULL
5994  * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
5995  * info.readonly = not PyArray_ISWRITEABLE(self)
5996  *
5997  */
5998  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
5999 
6000  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":250
6001  * info.suboffsets = NULL
6002  * info.itemsize = PyArray_ITEMSIZE(self)
6003  * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
6004  *
6005  * cdef int t
6006  */
6007  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
6008 
6009  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
6010  *
6011  * cdef int t
6012  * cdef char* f = NULL # <<<<<<<<<<<<<<
6013  * cdef dtype descr = self.descr
6014  * cdef int offset
6015  */
6016  __pyx_v_f = NULL;
6017 
6018  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254
6019  * cdef int t
6020  * cdef char* f = NULL
6021  * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
6022  * cdef int offset
6023  *
6024  */
6025  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
6026  __Pyx_INCREF(__pyx_t_3);
6027  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
6028  __pyx_t_3 = 0;
6029 
6030  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
6031  * cdef int offset
6032  *
6033  * info.obj = self # <<<<<<<<<<<<<<
6034  *
6035  * if not PyDataType_HASFIELDS(descr):
6036  */
6037  __Pyx_INCREF(((PyObject *)__pyx_v_self));
6038  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6039  __Pyx_GOTREF(__pyx_v_info->obj);
6040  __Pyx_DECREF(__pyx_v_info->obj);
6041  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
6042 
6043  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
6044  * info.obj = self
6045  *
6046  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
6047  * t = descr.type_num
6048  * if ((descr.byteorder == c'>' and little_endian) or
6049  */
6050  __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
6051  if (__pyx_t_1) {
6052 
6053  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
6054  *
6055  * if not PyDataType_HASFIELDS(descr):
6056  * t = descr.type_num # <<<<<<<<<<<<<<
6057  * if ((descr.byteorder == c'>' and little_endian) or
6058  * (descr.byteorder == c'<' and not little_endian)):
6059  */
6060  __pyx_t_4 = __pyx_v_descr->type_num;
6061  __pyx_v_t = __pyx_t_4;
6062 
6063  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
6064  * if not PyDataType_HASFIELDS(descr):
6065  * t = descr.type_num
6066  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6067  * (descr.byteorder == c'<' and not little_endian)):
6068  * raise ValueError(u"Non-native byte order not supported")
6069  */
6070  __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
6071  if (!__pyx_t_2) {
6072  goto __pyx_L15_next_or;
6073  } else {
6074  }
6075  __pyx_t_2 = (__pyx_v_little_endian != 0);
6076  if (!__pyx_t_2) {
6077  } else {
6078  __pyx_t_1 = __pyx_t_2;
6079  goto __pyx_L14_bool_binop_done;
6080  }
6081  __pyx_L15_next_or:;
6082 
6083  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
6084  * t = descr.type_num
6085  * if ((descr.byteorder == c'>' and little_endian) or
6086  * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
6087  * raise ValueError(u"Non-native byte order not supported")
6088  * if t == NPY_BYTE: f = "b"
6089  */
6090  __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
6091  if (__pyx_t_2) {
6092  } else {
6093  __pyx_t_1 = __pyx_t_2;
6094  goto __pyx_L14_bool_binop_done;
6095  }
6096  __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
6097  __pyx_t_1 = __pyx_t_2;
6098  __pyx_L14_bool_binop_done:;
6099 
6100  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
6101  * if not PyDataType_HASFIELDS(descr):
6102  * t = descr.type_num
6103  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6104  * (descr.byteorder == c'<' and not little_endian)):
6105  * raise ValueError(u"Non-native byte order not supported")
6106  */
6107  if (unlikely(__pyx_t_1)) {
6108 
6109  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
6110  * if ((descr.byteorder == c'>' and little_endian) or
6111  * (descr.byteorder == c'<' and not little_endian)):
6112  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
6113  * if t == NPY_BYTE: f = "b"
6114  * elif t == NPY_UBYTE: f = "B"
6115  */
6116  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 263, __pyx_L1_error)
6117  __Pyx_GOTREF(__pyx_t_3);
6118  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6119  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6120  __PYX_ERR(3, 263, __pyx_L1_error)
6121 
6122  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
6123  * if not PyDataType_HASFIELDS(descr):
6124  * t = descr.type_num
6125  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6126  * (descr.byteorder == c'<' and not little_endian)):
6127  * raise ValueError(u"Non-native byte order not supported")
6128  */
6129  }
6130 
6131  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
6132  * (descr.byteorder == c'<' and not little_endian)):
6133  * raise ValueError(u"Non-native byte order not supported")
6134  * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
6135  * elif t == NPY_UBYTE: f = "B"
6136  * elif t == NPY_SHORT: f = "h"
6137  */
6138  switch (__pyx_v_t) {
6139  case NPY_BYTE:
6140  __pyx_v_f = ((char *)"b");
6141  break;
6142 
6143  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
6144  * raise ValueError(u"Non-native byte order not supported")
6145  * if t == NPY_BYTE: f = "b"
6146  * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
6147  * elif t == NPY_SHORT: f = "h"
6148  * elif t == NPY_USHORT: f = "H"
6149  */
6150  case NPY_UBYTE:
6151  __pyx_v_f = ((char *)"B");
6152  break;
6153 
6154  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
6155  * if t == NPY_BYTE: f = "b"
6156  * elif t == NPY_UBYTE: f = "B"
6157  * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
6158  * elif t == NPY_USHORT: f = "H"
6159  * elif t == NPY_INT: f = "i"
6160  */
6161  case NPY_SHORT:
6162  __pyx_v_f = ((char *)"h");
6163  break;
6164 
6165  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
6166  * elif t == NPY_UBYTE: f = "B"
6167  * elif t == NPY_SHORT: f = "h"
6168  * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
6169  * elif t == NPY_INT: f = "i"
6170  * elif t == NPY_UINT: f = "I"
6171  */
6172  case NPY_USHORT:
6173  __pyx_v_f = ((char *)"H");
6174  break;
6175 
6176  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
6177  * elif t == NPY_SHORT: f = "h"
6178  * elif t == NPY_USHORT: f = "H"
6179  * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
6180  * elif t == NPY_UINT: f = "I"
6181  * elif t == NPY_LONG: f = "l"
6182  */
6183  case NPY_INT:
6184  __pyx_v_f = ((char *)"i");
6185  break;
6186 
6187  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
6188  * elif t == NPY_USHORT: f = "H"
6189  * elif t == NPY_INT: f = "i"
6190  * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
6191  * elif t == NPY_LONG: f = "l"
6192  * elif t == NPY_ULONG: f = "L"
6193  */
6194  case NPY_UINT:
6195  __pyx_v_f = ((char *)"I");
6196  break;
6197 
6198  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6199  * elif t == NPY_INT: f = "i"
6200  * elif t == NPY_UINT: f = "I"
6201  * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
6202  * elif t == NPY_ULONG: f = "L"
6203  * elif t == NPY_LONGLONG: f = "q"
6204  */
6205  case NPY_LONG:
6206  __pyx_v_f = ((char *)"l");
6207  break;
6208 
6209  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
6210  * elif t == NPY_UINT: f = "I"
6211  * elif t == NPY_LONG: f = "l"
6212  * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
6213  * elif t == NPY_LONGLONG: f = "q"
6214  * elif t == NPY_ULONGLONG: f = "Q"
6215  */
6216  case NPY_ULONG:
6217  __pyx_v_f = ((char *)"L");
6218  break;
6219 
6220  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
6221  * elif t == NPY_LONG: f = "l"
6222  * elif t == NPY_ULONG: f = "L"
6223  * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
6224  * elif t == NPY_ULONGLONG: f = "Q"
6225  * elif t == NPY_FLOAT: f = "f"
6226  */
6227  case NPY_LONGLONG:
6228  __pyx_v_f = ((char *)"q");
6229  break;
6230 
6231  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
6232  * elif t == NPY_ULONG: f = "L"
6233  * elif t == NPY_LONGLONG: f = "q"
6234  * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
6235  * elif t == NPY_FLOAT: f = "f"
6236  * elif t == NPY_DOUBLE: f = "d"
6237  */
6238  case NPY_ULONGLONG:
6239  __pyx_v_f = ((char *)"Q");
6240  break;
6241 
6242  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
6243  * elif t == NPY_LONGLONG: f = "q"
6244  * elif t == NPY_ULONGLONG: f = "Q"
6245  * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
6246  * elif t == NPY_DOUBLE: f = "d"
6247  * elif t == NPY_LONGDOUBLE: f = "g"
6248  */
6249  case NPY_FLOAT:
6250  __pyx_v_f = ((char *)"f");
6251  break;
6252 
6253  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
6254  * elif t == NPY_ULONGLONG: f = "Q"
6255  * elif t == NPY_FLOAT: f = "f"
6256  * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
6257  * elif t == NPY_LONGDOUBLE: f = "g"
6258  * elif t == NPY_CFLOAT: f = "Zf"
6259  */
6260  case NPY_DOUBLE:
6261  __pyx_v_f = ((char *)"d");
6262  break;
6263 
6264  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
6265  * elif t == NPY_FLOAT: f = "f"
6266  * elif t == NPY_DOUBLE: f = "d"
6267  * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
6268  * elif t == NPY_CFLOAT: f = "Zf"
6269  * elif t == NPY_CDOUBLE: f = "Zd"
6270  */
6271  case NPY_LONGDOUBLE:
6272  __pyx_v_f = ((char *)"g");
6273  break;
6274 
6275  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277
6276  * elif t == NPY_DOUBLE: f = "d"
6277  * elif t == NPY_LONGDOUBLE: f = "g"
6278  * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
6279  * elif t == NPY_CDOUBLE: f = "Zd"
6280  * elif t == NPY_CLONGDOUBLE: f = "Zg"
6281  */
6282  case NPY_CFLOAT:
6283  __pyx_v_f = ((char *)"Zf");
6284  break;
6285 
6286  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
6287  * elif t == NPY_LONGDOUBLE: f = "g"
6288  * elif t == NPY_CFLOAT: f = "Zf"
6289  * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
6290  * elif t == NPY_CLONGDOUBLE: f = "Zg"
6291  * elif t == NPY_OBJECT: f = "O"
6292  */
6293  case NPY_CDOUBLE:
6294  __pyx_v_f = ((char *)"Zd");
6295  break;
6296 
6297  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
6298  * elif t == NPY_CFLOAT: f = "Zf"
6299  * elif t == NPY_CDOUBLE: f = "Zd"
6300  * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
6301  * elif t == NPY_OBJECT: f = "O"
6302  * else:
6303  */
6304  case NPY_CLONGDOUBLE:
6305  __pyx_v_f = ((char *)"Zg");
6306  break;
6307 
6308  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
6309  * elif t == NPY_CDOUBLE: f = "Zd"
6310  * elif t == NPY_CLONGDOUBLE: f = "Zg"
6311  * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
6312  * else:
6313  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6314  */
6315  case NPY_OBJECT:
6316  __pyx_v_f = ((char *)"O");
6317  break;
6318  default:
6319 
6320  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
6321  * elif t == NPY_OBJECT: f = "O"
6322  * else:
6323  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
6324  * info.format = f
6325  * return
6326  */
6327  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 282, __pyx_L1_error)
6328  __Pyx_GOTREF(__pyx_t_3);
6329  __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 282, __pyx_L1_error)
6330  __Pyx_GOTREF(__pyx_t_7);
6331  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6332  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 282, __pyx_L1_error)
6333  __Pyx_GOTREF(__pyx_t_3);
6334  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6335  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6336  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6337  __PYX_ERR(3, 282, __pyx_L1_error)
6338  break;
6339  }
6340 
6341  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
6342  * else:
6343  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6344  * info.format = f # <<<<<<<<<<<<<<
6345  * return
6346  * else:
6347  */
6348  __pyx_v_info->format = __pyx_v_f;
6349 
6350  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
6351  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6352  * info.format = f
6353  * return # <<<<<<<<<<<<<<
6354  * else:
6355  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
6356  */
6357  __pyx_r = 0;
6358  goto __pyx_L0;
6359 
6360  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
6361  * info.obj = self
6362  *
6363  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
6364  * t = descr.type_num
6365  * if ((descr.byteorder == c'>' and little_endian) or
6366  */
6367  }
6368 
6369  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
6370  * return
6371  * else:
6372  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
6373  * info.format[0] = c'^' # Native data types, manual alignment
6374  * offset = 0
6375  */
6376  /*else*/ {
6377  __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
6378 
6379  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":287
6380  * else:
6381  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
6382  * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
6383  * offset = 0
6384  * f = _util_dtypestring(descr, info.format + 1,
6385  */
6386  (__pyx_v_info->format[0]) = '^';
6387 
6388  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
6389  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
6390  * info.format[0] = c'^' # Native data types, manual alignment
6391  * offset = 0 # <<<<<<<<<<<<<<
6392  * f = _util_dtypestring(descr, info.format + 1,
6393  * info.format + _buffer_format_string_len,
6394  */
6395  __pyx_v_offset = 0;
6396 
6397  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
6398  * info.format[0] = c'^' # Native data types, manual alignment
6399  * offset = 0
6400  * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
6401  * info.format + _buffer_format_string_len,
6402  * &offset)
6403  */
6404  __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(3, 289, __pyx_L1_error)
6405  __pyx_v_f = __pyx_t_8;
6406 
6407  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
6408  * info.format + _buffer_format_string_len,
6409  * &offset)
6410  * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
6411  *
6412  * def __releasebuffer__(ndarray self, Py_buffer* info):
6413  */
6414  (__pyx_v_f[0]) = '\x00';
6415  }
6416 
6417  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
6418  * # experimental exception made for __getbuffer__ and __releasebuffer__
6419  * # -- the details of this may change.
6420  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
6421  * # This implementation of getbuffer is geared towards Cython
6422  * # requirements, and does not yet fulfill the PEP.
6423  */
6424 
6425  /* function exit code */
6426  __pyx_r = 0;
6427  goto __pyx_L0;
6428  __pyx_L1_error:;
6429  __Pyx_XDECREF(__pyx_t_3);
6430  __Pyx_XDECREF(__pyx_t_7);
6431  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6432  __pyx_r = -1;
6433  if (__pyx_v_info->obj != NULL) {
6434  __Pyx_GOTREF(__pyx_v_info->obj);
6435  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6436  }
6437  goto __pyx_L2;
6438  __pyx_L0:;
6439  if (__pyx_v_info->obj == Py_None) {
6440  __Pyx_GOTREF(__pyx_v_info->obj);
6441  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6442  }
6443  __pyx_L2:;
6444  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
6445  __Pyx_RefNannyFinishContext();
6446  return __pyx_r;
6447 }
6448 
6449 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294
6450  * f[0] = c'\0' # Terminate format string
6451  *
6452  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
6453  * if PyArray_HASFIELDS(self):
6454  * PyObject_Free(info.format)
6455  */
6456 
6457 /* Python wrapper */
6458 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
6459 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6460  __Pyx_RefNannyDeclarations
6461  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
6462  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
6463 
6464  /* function exit code */
6465  __Pyx_RefNannyFinishContext();
6466 }
6467 
6468 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6469  __Pyx_RefNannyDeclarations
6470  int __pyx_t_1;
6471  __Pyx_RefNannySetupContext("__releasebuffer__", 0);
6472 
6473  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":295
6474  *
6475  * def __releasebuffer__(ndarray self, Py_buffer* info):
6476  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
6477  * PyObject_Free(info.format)
6478  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6479  */
6480  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
6481  if (__pyx_t_1) {
6482 
6483  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":296
6484  * def __releasebuffer__(ndarray self, Py_buffer* info):
6485  * if PyArray_HASFIELDS(self):
6486  * PyObject_Free(info.format) # <<<<<<<<<<<<<<
6487  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6488  * PyObject_Free(info.strides)
6489  */
6490  PyObject_Free(__pyx_v_info->format);
6491 
6492  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":295
6493  *
6494  * def __releasebuffer__(ndarray self, Py_buffer* info):
6495  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
6496  * PyObject_Free(info.format)
6497  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6498  */
6499  }
6500 
6501  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
6502  * if PyArray_HASFIELDS(self):
6503  * PyObject_Free(info.format)
6504  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6505  * PyObject_Free(info.strides)
6506  * # info.shape was stored after info.strides in the same block
6507  */
6508  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
6509  if (__pyx_t_1) {
6510 
6511  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":298
6512  * PyObject_Free(info.format)
6513  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6514  * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
6515  * # info.shape was stored after info.strides in the same block
6516  *
6517  */
6518  PyObject_Free(__pyx_v_info->strides);
6519 
6520  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
6521  * if PyArray_HASFIELDS(self):
6522  * PyObject_Free(info.format)
6523  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6524  * PyObject_Free(info.strides)
6525  * # info.shape was stored after info.strides in the same block
6526  */
6527  }
6528 
6529  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294
6530  * f[0] = c'\0' # Terminate format string
6531  *
6532  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
6533  * if PyArray_HASFIELDS(self):
6534  * PyObject_Free(info.format)
6535  */
6536 
6537  /* function exit code */
6538  __Pyx_RefNannyFinishContext();
6539 }
6540 
6541 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
6542  * ctypedef npy_cdouble complex_t
6543  *
6544  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6545  * return PyArray_MultiIterNew(1, <void*>a)
6546  *
6547  */
6548 
6549 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6550  PyObject *__pyx_r = NULL;
6551  __Pyx_RefNannyDeclarations
6552  PyObject *__pyx_t_1 = NULL;
6553  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
6554 
6555  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
6556  *
6557  * cdef inline object PyArray_MultiIterNew1(a):
6558  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
6559  *
6560  * cdef inline object PyArray_MultiIterNew2(a, b):
6561  */
6562  __Pyx_XDECREF(__pyx_r);
6563  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 776, __pyx_L1_error)
6564  __Pyx_GOTREF(__pyx_t_1);
6565  __pyx_r = __pyx_t_1;
6566  __pyx_t_1 = 0;
6567  goto __pyx_L0;
6568 
6569  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
6570  * ctypedef npy_cdouble complex_t
6571  *
6572  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6573  * return PyArray_MultiIterNew(1, <void*>a)
6574  *
6575  */
6576 
6577  /* function exit code */
6578  __pyx_L1_error:;
6579  __Pyx_XDECREF(__pyx_t_1);
6580  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6581  __pyx_r = 0;
6582  __pyx_L0:;
6583  __Pyx_XGIVEREF(__pyx_r);
6584  __Pyx_RefNannyFinishContext();
6585  return __pyx_r;
6586 }
6587 
6588 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
6589  * return PyArray_MultiIterNew(1, <void*>a)
6590  *
6591  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6592  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6593  *
6594  */
6595 
6596 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6597  PyObject *__pyx_r = NULL;
6598  __Pyx_RefNannyDeclarations
6599  PyObject *__pyx_t_1 = NULL;
6600  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
6601 
6602  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
6603  *
6604  * cdef inline object PyArray_MultiIterNew2(a, b):
6605  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
6606  *
6607  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6608  */
6609  __Pyx_XDECREF(__pyx_r);
6610  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 779, __pyx_L1_error)
6611  __Pyx_GOTREF(__pyx_t_1);
6612  __pyx_r = __pyx_t_1;
6613  __pyx_t_1 = 0;
6614  goto __pyx_L0;
6615 
6616  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
6617  * return PyArray_MultiIterNew(1, <void*>a)
6618  *
6619  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6620  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6621  *
6622  */
6623 
6624  /* function exit code */
6625  __pyx_L1_error:;
6626  __Pyx_XDECREF(__pyx_t_1);
6627  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6628  __pyx_r = 0;
6629  __pyx_L0:;
6630  __Pyx_XGIVEREF(__pyx_r);
6631  __Pyx_RefNannyFinishContext();
6632  return __pyx_r;
6633 }
6634 
6635 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
6636  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6637  *
6638  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6639  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6640  *
6641  */
6642 
6643 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6644  PyObject *__pyx_r = NULL;
6645  __Pyx_RefNannyDeclarations
6646  PyObject *__pyx_t_1 = NULL;
6647  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
6648 
6649  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782
6650  *
6651  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6652  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
6653  *
6654  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6655  */
6656  __Pyx_XDECREF(__pyx_r);
6657  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 782, __pyx_L1_error)
6658  __Pyx_GOTREF(__pyx_t_1);
6659  __pyx_r = __pyx_t_1;
6660  __pyx_t_1 = 0;
6661  goto __pyx_L0;
6662 
6663  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
6664  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6665  *
6666  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6667  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6668  *
6669  */
6670 
6671  /* function exit code */
6672  __pyx_L1_error:;
6673  __Pyx_XDECREF(__pyx_t_1);
6674  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6675  __pyx_r = 0;
6676  __pyx_L0:;
6677  __Pyx_XGIVEREF(__pyx_r);
6678  __Pyx_RefNannyFinishContext();
6679  return __pyx_r;
6680 }
6681 
6682 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
6683  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6684  *
6685  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6686  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6687  *
6688  */
6689 
6690 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
6691  PyObject *__pyx_r = NULL;
6692  __Pyx_RefNannyDeclarations
6693  PyObject *__pyx_t_1 = NULL;
6694  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
6695 
6696  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
6697  *
6698  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6699  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
6700  *
6701  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6702  */
6703  __Pyx_XDECREF(__pyx_r);
6704  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 785, __pyx_L1_error)
6705  __Pyx_GOTREF(__pyx_t_1);
6706  __pyx_r = __pyx_t_1;
6707  __pyx_t_1 = 0;
6708  goto __pyx_L0;
6709 
6710  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
6711  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6712  *
6713  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6714  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6715  *
6716  */
6717 
6718  /* function exit code */
6719  __pyx_L1_error:;
6720  __Pyx_XDECREF(__pyx_t_1);
6721  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6722  __pyx_r = 0;
6723  __pyx_L0:;
6724  __Pyx_XGIVEREF(__pyx_r);
6725  __Pyx_RefNannyFinishContext();
6726  return __pyx_r;
6727 }
6728 
6729 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":787
6730  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6731  *
6732  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6733  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6734  *
6735  */
6736 
6737 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
6738  PyObject *__pyx_r = NULL;
6739  __Pyx_RefNannyDeclarations
6740  PyObject *__pyx_t_1 = NULL;
6741  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
6742 
6743  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":788
6744  *
6745  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6746  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
6747  *
6748  * cdef inline tuple PyDataType_SHAPE(dtype d):
6749  */
6750  __Pyx_XDECREF(__pyx_r);
6751  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 788, __pyx_L1_error)
6752  __Pyx_GOTREF(__pyx_t_1);
6753  __pyx_r = __pyx_t_1;
6754  __pyx_t_1 = 0;
6755  goto __pyx_L0;
6756 
6757  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":787
6758  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6759  *
6760  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6761  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6762  *
6763  */
6764 
6765  /* function exit code */
6766  __pyx_L1_error:;
6767  __Pyx_XDECREF(__pyx_t_1);
6768  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6769  __pyx_r = 0;
6770  __pyx_L0:;
6771  __Pyx_XGIVEREF(__pyx_r);
6772  __Pyx_RefNannyFinishContext();
6773  return __pyx_r;
6774 }
6775 
6776 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
6777  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6778  *
6779  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6780  * if PyDataType_HASSUBARRAY(d):
6781  * return <tuple>d.subarray.shape
6782  */
6783 
6784 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6785  PyObject *__pyx_r = NULL;
6786  __Pyx_RefNannyDeclarations
6787  int __pyx_t_1;
6788  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
6789 
6790  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
6791  *
6792  * cdef inline tuple PyDataType_SHAPE(dtype d):
6793  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6794  * return <tuple>d.subarray.shape
6795  * else:
6796  */
6797  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6798  if (__pyx_t_1) {
6799 
6800  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":792
6801  * cdef inline tuple PyDataType_SHAPE(dtype d):
6802  * if PyDataType_HASSUBARRAY(d):
6803  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
6804  * else:
6805  * return ()
6806  */
6807  __Pyx_XDECREF(__pyx_r);
6808  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6809  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6810  goto __pyx_L0;
6811 
6812  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
6813  *
6814  * cdef inline tuple PyDataType_SHAPE(dtype d):
6815  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6816  * return <tuple>d.subarray.shape
6817  * else:
6818  */
6819  }
6820 
6821  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
6822  * return <tuple>d.subarray.shape
6823  * else:
6824  * return () # <<<<<<<<<<<<<<
6825  *
6826  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
6827  */
6828  /*else*/ {
6829  __Pyx_XDECREF(__pyx_r);
6830  __Pyx_INCREF(__pyx_empty_tuple);
6831  __pyx_r = __pyx_empty_tuple;
6832  goto __pyx_L0;
6833  }
6834 
6835  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
6836  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6837  *
6838  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6839  * if PyDataType_HASSUBARRAY(d):
6840  * return <tuple>d.subarray.shape
6841  */
6842 
6843  /* function exit code */
6844  __pyx_L0:;
6845  __Pyx_XGIVEREF(__pyx_r);
6846  __Pyx_RefNannyFinishContext();
6847  return __pyx_r;
6848 }
6849 
6850 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
6851  * return ()
6852  *
6853  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
6854  * # Recursive utility function used in __getbuffer__ to get format
6855  * # string. The new location in the format string is returned.
6856  */
6857 
6858 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
6859  PyArray_Descr *__pyx_v_child = 0;
6860  int __pyx_v_endian_detector;
6861  int __pyx_v_little_endian;
6862  PyObject *__pyx_v_fields = 0;
6863  PyObject *__pyx_v_childname = NULL;
6864  PyObject *__pyx_v_new_offset = NULL;
6865  PyObject *__pyx_v_t = NULL;
6866  char *__pyx_r;
6867  __Pyx_RefNannyDeclarations
6868  PyObject *__pyx_t_1 = NULL;
6869  Py_ssize_t __pyx_t_2;
6870  PyObject *__pyx_t_3 = NULL;
6871  PyObject *__pyx_t_4 = NULL;
6872  int __pyx_t_5;
6873  int __pyx_t_6;
6874  int __pyx_t_7;
6875  long __pyx_t_8;
6876  char *__pyx_t_9;
6877  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
6878 
6879  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
6880  *
6881  * cdef dtype child
6882  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
6883  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6884  * cdef tuple fields
6885  */
6886  __pyx_v_endian_detector = 1;
6887 
6888  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
6889  * cdef dtype child
6890  * cdef int endian_detector = 1
6891  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
6892  * cdef tuple fields
6893  *
6894  */
6895  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
6896 
6897  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
6898  * cdef tuple fields
6899  *
6900  * for childname in descr.names: # <<<<<<<<<<<<<<
6901  * fields = descr.fields[childname]
6902  * child, new_offset = fields
6903  */
6904  if (unlikely(__pyx_v_descr->names == Py_None)) {
6905  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
6906  __PYX_ERR(3, 805, __pyx_L1_error)
6907  }
6908  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6909  for (;;) {
6910  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
6911  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6912  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 805, __pyx_L1_error)
6913  #else
6914  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 805, __pyx_L1_error)
6915  __Pyx_GOTREF(__pyx_t_3);
6916  #endif
6917  __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
6918  __pyx_t_3 = 0;
6919 
6920  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806
6921  *
6922  * for childname in descr.names:
6923  * fields = descr.fields[childname] # <<<<<<<<<<<<<<
6924  * child, new_offset = fields
6925  *
6926  */
6927  if (unlikely(__pyx_v_descr->fields == Py_None)) {
6928  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6929  __PYX_ERR(3, 806, __pyx_L1_error)
6930  }
6931  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 806, __pyx_L1_error)
6932  __Pyx_GOTREF(__pyx_t_3);
6933  if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 806, __pyx_L1_error)
6934  __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
6935  __pyx_t_3 = 0;
6936 
6937  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":807
6938  * for childname in descr.names:
6939  * fields = descr.fields[childname]
6940  * child, new_offset = fields # <<<<<<<<<<<<<<
6941  *
6942  * if (end - f) - <int>(new_offset - offset[0]) < 15:
6943  */
6944  if (likely(__pyx_v_fields != Py_None)) {
6945  PyObject* sequence = __pyx_v_fields;
6946  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6947  if (unlikely(size != 2)) {
6948  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6949  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6950  __PYX_ERR(3, 807, __pyx_L1_error)
6951  }
6952  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6953  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
6954  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
6955  __Pyx_INCREF(__pyx_t_3);
6956  __Pyx_INCREF(__pyx_t_4);
6957  #else
6958  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 807, __pyx_L1_error)
6959  __Pyx_GOTREF(__pyx_t_3);
6960  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 807, __pyx_L1_error)
6961  __Pyx_GOTREF(__pyx_t_4);
6962  #endif
6963  } else {
6964  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 807, __pyx_L1_error)
6965  }
6966  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 807, __pyx_L1_error)
6967  __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
6968  __pyx_t_3 = 0;
6969  __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
6970  __pyx_t_4 = 0;
6971 
6972  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
6973  * child, new_offset = fields
6974  *
6975  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
6976  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6977  *
6978  */
6979  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 809, __pyx_L1_error)
6980  __Pyx_GOTREF(__pyx_t_4);
6981  __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 809, __pyx_L1_error)
6982  __Pyx_GOTREF(__pyx_t_3);
6983  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6984  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 809, __pyx_L1_error)
6985  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6986  __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
6987  if (unlikely(__pyx_t_6)) {
6988 
6989  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":810
6990  *
6991  * if (end - f) - <int>(new_offset - offset[0]) < 15:
6992  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
6993  *
6994  * if ((child.byteorder == c'>' and little_endian) or
6995  */
6996  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 810, __pyx_L1_error)
6997  __Pyx_GOTREF(__pyx_t_3);
6998  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6999  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7000  __PYX_ERR(3, 810, __pyx_L1_error)
7001 
7002  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
7003  * child, new_offset = fields
7004  *
7005  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7006  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7007  *
7008  */
7009  }
7010 
7011  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
7012  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7013  *
7014  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7015  * (child.byteorder == c'<' and not little_endian)):
7016  * raise ValueError(u"Non-native byte order not supported")
7017  */
7018  __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
7019  if (!__pyx_t_7) {
7020  goto __pyx_L8_next_or;
7021  } else {
7022  }
7023  __pyx_t_7 = (__pyx_v_little_endian != 0);
7024  if (!__pyx_t_7) {
7025  } else {
7026  __pyx_t_6 = __pyx_t_7;
7027  goto __pyx_L7_bool_binop_done;
7028  }
7029  __pyx_L8_next_or:;
7030 
7031  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
7032  *
7033  * if ((child.byteorder == c'>' and little_endian) or
7034  * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
7035  * raise ValueError(u"Non-native byte order not supported")
7036  * # One could encode it in the format string and have Cython
7037  */
7038  __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
7039  if (__pyx_t_7) {
7040  } else {
7041  __pyx_t_6 = __pyx_t_7;
7042  goto __pyx_L7_bool_binop_done;
7043  }
7044  __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
7045  __pyx_t_6 = __pyx_t_7;
7046  __pyx_L7_bool_binop_done:;
7047 
7048  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
7049  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7050  *
7051  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7052  * (child.byteorder == c'<' and not little_endian)):
7053  * raise ValueError(u"Non-native byte order not supported")
7054  */
7055  if (unlikely(__pyx_t_6)) {
7056 
7057  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
7058  * if ((child.byteorder == c'>' and little_endian) or
7059  * (child.byteorder == c'<' and not little_endian)):
7060  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
7061  * # One could encode it in the format string and have Cython
7062  * # complain instead, BUT: < and > in format strings also imply
7063  */
7064  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 814, __pyx_L1_error)
7065  __Pyx_GOTREF(__pyx_t_3);
7066  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7067  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7068  __PYX_ERR(3, 814, __pyx_L1_error)
7069 
7070  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
7071  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7072  *
7073  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7074  * (child.byteorder == c'<' and not little_endian)):
7075  * raise ValueError(u"Non-native byte order not supported")
7076  */
7077  }
7078 
7079  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
7080  *
7081  * # Output padding bytes
7082  * while offset[0] < new_offset: # <<<<<<<<<<<<<<
7083  * f[0] = 120 # "x"; pad byte
7084  * f += 1
7085  */
7086  while (1) {
7087  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 824, __pyx_L1_error)
7088  __Pyx_GOTREF(__pyx_t_3);
7089  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 824, __pyx_L1_error)
7090  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7091  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 824, __pyx_L1_error)
7092  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7093  if (!__pyx_t_6) break;
7094 
7095  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":825
7096  * # Output padding bytes
7097  * while offset[0] < new_offset:
7098  * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
7099  * f += 1
7100  * offset[0] += 1
7101  */
7102  (__pyx_v_f[0]) = 0x78;
7103 
7104  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
7105  * while offset[0] < new_offset:
7106  * f[0] = 120 # "x"; pad byte
7107  * f += 1 # <<<<<<<<<<<<<<
7108  * offset[0] += 1
7109  *
7110  */
7111  __pyx_v_f = (__pyx_v_f + 1);
7112 
7113  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
7114  * f[0] = 120 # "x"; pad byte
7115  * f += 1
7116  * offset[0] += 1 # <<<<<<<<<<<<<<
7117  *
7118  * offset[0] += child.itemsize
7119  */
7120  __pyx_t_8 = 0;
7121  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
7122  }
7123 
7124  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
7125  * offset[0] += 1
7126  *
7127  * offset[0] += child.itemsize # <<<<<<<<<<<<<<
7128  *
7129  * if not PyDataType_HASFIELDS(child):
7130  */
7131  __pyx_t_8 = 0;
7132  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
7133 
7134  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
7135  * offset[0] += child.itemsize
7136  *
7137  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7138  * t = child.type_num
7139  * if end - f < 5:
7140  */
7141  __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
7142  if (__pyx_t_6) {
7143 
7144  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
7145  *
7146  * if not PyDataType_HASFIELDS(child):
7147  * t = child.type_num # <<<<<<<<<<<<<<
7148  * if end - f < 5:
7149  * raise RuntimeError(u"Format string allocated too short.")
7150  */
7151  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __pyx_L1_error)
7152  __Pyx_GOTREF(__pyx_t_4);
7153  __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
7154  __pyx_t_4 = 0;
7155 
7156  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
7157  * if not PyDataType_HASFIELDS(child):
7158  * t = child.type_num
7159  * if end - f < 5: # <<<<<<<<<<<<<<
7160  * raise RuntimeError(u"Format string allocated too short.")
7161  *
7162  */
7163  __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
7164  if (unlikely(__pyx_t_6)) {
7165 
7166  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
7167  * t = child.type_num
7168  * if end - f < 5:
7169  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
7170  *
7171  * # Until ticket #99 is fixed, use integers to avoid warnings
7172  */
7173  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 834, __pyx_L1_error)
7174  __Pyx_GOTREF(__pyx_t_4);
7175  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7176  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7177  __PYX_ERR(3, 834, __pyx_L1_error)
7178 
7179  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
7180  * if not PyDataType_HASFIELDS(child):
7181  * t = child.type_num
7182  * if end - f < 5: # <<<<<<<<<<<<<<
7183  * raise RuntimeError(u"Format string allocated too short.")
7184  *
7185  */
7186  }
7187 
7188  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
7189  *
7190  * # Until ticket #99 is fixed, use integers to avoid warnings
7191  * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
7192  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7193  * elif t == NPY_SHORT: f[0] = 104 #"h"
7194  */
7195  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error)
7196  __Pyx_GOTREF(__pyx_t_4);
7197  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 837, __pyx_L1_error)
7198  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7199  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error)
7200  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7201  if (__pyx_t_6) {
7202  (__pyx_v_f[0]) = 98;
7203  goto __pyx_L15;
7204  }
7205 
7206  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
7207  * # Until ticket #99 is fixed, use integers to avoid warnings
7208  * if t == NPY_BYTE: f[0] = 98 #"b"
7209  * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
7210  * elif t == NPY_SHORT: f[0] = 104 #"h"
7211  * elif t == NPY_USHORT: f[0] = 72 #"H"
7212  */
7213  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error)
7214  __Pyx_GOTREF(__pyx_t_3);
7215  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 838, __pyx_L1_error)
7216  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7217  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error)
7218  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7219  if (__pyx_t_6) {
7220  (__pyx_v_f[0]) = 66;
7221  goto __pyx_L15;
7222  }
7223 
7224  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
7225  * if t == NPY_BYTE: f[0] = 98 #"b"
7226  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7227  * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
7228  * elif t == NPY_USHORT: f[0] = 72 #"H"
7229  * elif t == NPY_INT: f[0] = 105 #"i"
7230  */
7231  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error)
7232  __Pyx_GOTREF(__pyx_t_4);
7233  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 839, __pyx_L1_error)
7234  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7235  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error)
7236  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7237  if (__pyx_t_6) {
7238  (__pyx_v_f[0]) = 0x68;
7239  goto __pyx_L15;
7240  }
7241 
7242  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
7243  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7244  * elif t == NPY_SHORT: f[0] = 104 #"h"
7245  * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
7246  * elif t == NPY_INT: f[0] = 105 #"i"
7247  * elif t == NPY_UINT: f[0] = 73 #"I"
7248  */
7249  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error)
7250  __Pyx_GOTREF(__pyx_t_3);
7251  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 840, __pyx_L1_error)
7252  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7253  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error)
7254  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7255  if (__pyx_t_6) {
7256  (__pyx_v_f[0]) = 72;
7257  goto __pyx_L15;
7258  }
7259 
7260  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
7261  * elif t == NPY_SHORT: f[0] = 104 #"h"
7262  * elif t == NPY_USHORT: f[0] = 72 #"H"
7263  * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
7264  * elif t == NPY_UINT: f[0] = 73 #"I"
7265  * elif t == NPY_LONG: f[0] = 108 #"l"
7266  */
7267  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error)
7268  __Pyx_GOTREF(__pyx_t_4);
7269  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error)
7270  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7271  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error)
7272  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7273  if (__pyx_t_6) {
7274  (__pyx_v_f[0]) = 0x69;
7275  goto __pyx_L15;
7276  }
7277 
7278  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
7279  * elif t == NPY_USHORT: f[0] = 72 #"H"
7280  * elif t == NPY_INT: f[0] = 105 #"i"
7281  * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
7282  * elif t == NPY_LONG: f[0] = 108 #"l"
7283  * elif t == NPY_ULONG: f[0] = 76 #"L"
7284  */
7285  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error)
7286  __Pyx_GOTREF(__pyx_t_3);
7287  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 842, __pyx_L1_error)
7288  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7289  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error)
7290  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7291  if (__pyx_t_6) {
7292  (__pyx_v_f[0]) = 73;
7293  goto __pyx_L15;
7294  }
7295 
7296  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":843
7297  * elif t == NPY_INT: f[0] = 105 #"i"
7298  * elif t == NPY_UINT: f[0] = 73 #"I"
7299  * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
7300  * elif t == NPY_ULONG: f[0] = 76 #"L"
7301  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7302  */
7303  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 843, __pyx_L1_error)
7304  __Pyx_GOTREF(__pyx_t_4);
7305  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 843, __pyx_L1_error)
7306  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7307  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 843, __pyx_L1_error)
7308  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7309  if (__pyx_t_6) {
7310  (__pyx_v_f[0]) = 0x6C;
7311  goto __pyx_L15;
7312  }
7313 
7314  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
7315  * elif t == NPY_UINT: f[0] = 73 #"I"
7316  * elif t == NPY_LONG: f[0] = 108 #"l"
7317  * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
7318  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7319  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7320  */
7321  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error)
7322  __Pyx_GOTREF(__pyx_t_3);
7323  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __pyx_L1_error)
7324  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7325  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 844, __pyx_L1_error)
7326  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7327  if (__pyx_t_6) {
7328  (__pyx_v_f[0]) = 76;
7329  goto __pyx_L15;
7330  }
7331 
7332  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
7333  * elif t == NPY_LONG: f[0] = 108 #"l"
7334  * elif t == NPY_ULONG: f[0] = 76 #"L"
7335  * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
7336  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7337  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7338  */
7339  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 845, __pyx_L1_error)
7340  __Pyx_GOTREF(__pyx_t_4);
7341  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 845, __pyx_L1_error)
7342  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7343  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 845, __pyx_L1_error)
7344  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7345  if (__pyx_t_6) {
7346  (__pyx_v_f[0]) = 0x71;
7347  goto __pyx_L15;
7348  }
7349 
7350  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":846
7351  * elif t == NPY_ULONG: f[0] = 76 #"L"
7352  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7353  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
7354  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7355  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7356  */
7357  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 846, __pyx_L1_error)
7358  __Pyx_GOTREF(__pyx_t_3);
7359  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 846, __pyx_L1_error)
7360  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7361  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 846, __pyx_L1_error)
7362  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7363  if (__pyx_t_6) {
7364  (__pyx_v_f[0]) = 81;
7365  goto __pyx_L15;
7366  }
7367 
7368  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":847
7369  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7370  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7371  * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
7372  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7373  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7374  */
7375  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 847, __pyx_L1_error)
7376  __Pyx_GOTREF(__pyx_t_4);
7377  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 847, __pyx_L1_error)
7378  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7379  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 847, __pyx_L1_error)
7380  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7381  if (__pyx_t_6) {
7382  (__pyx_v_f[0]) = 0x66;
7383  goto __pyx_L15;
7384  }
7385 
7386  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":848
7387  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7388  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7389  * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
7390  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7391  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7392  */
7393  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 848, __pyx_L1_error)
7394  __Pyx_GOTREF(__pyx_t_3);
7395  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 848, __pyx_L1_error)
7396  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7397  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 848, __pyx_L1_error)
7398  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7399  if (__pyx_t_6) {
7400  (__pyx_v_f[0]) = 0x64;
7401  goto __pyx_L15;
7402  }
7403 
7404  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849
7405  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7406  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7407  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
7408  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7409  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7410  */
7411  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 849, __pyx_L1_error)
7412  __Pyx_GOTREF(__pyx_t_4);
7413  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 849, __pyx_L1_error)
7414  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7415  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 849, __pyx_L1_error)
7416  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7417  if (__pyx_t_6) {
7418  (__pyx_v_f[0]) = 0x67;
7419  goto __pyx_L15;
7420  }
7421 
7422  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
7423  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7424  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7425  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
7426  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7427  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7428  */
7429  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 850, __pyx_L1_error)
7430  __Pyx_GOTREF(__pyx_t_3);
7431  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 850, __pyx_L1_error)
7432  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7433  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 850, __pyx_L1_error)
7434  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7435  if (__pyx_t_6) {
7436  (__pyx_v_f[0]) = 90;
7437  (__pyx_v_f[1]) = 0x66;
7438  __pyx_v_f = (__pyx_v_f + 1);
7439  goto __pyx_L15;
7440  }
7441 
7442  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
7443  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7444  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7445  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
7446  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7447  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7448  */
7449  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 851, __pyx_L1_error)
7450  __Pyx_GOTREF(__pyx_t_4);
7451  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 851, __pyx_L1_error)
7452  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7453  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 851, __pyx_L1_error)
7454  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7455  if (__pyx_t_6) {
7456  (__pyx_v_f[0]) = 90;
7457  (__pyx_v_f[1]) = 0x64;
7458  __pyx_v_f = (__pyx_v_f + 1);
7459  goto __pyx_L15;
7460  }
7461 
7462  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":852
7463  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7464  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7465  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
7466  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7467  * else:
7468  */
7469  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 852, __pyx_L1_error)
7470  __Pyx_GOTREF(__pyx_t_3);
7471  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 852, __pyx_L1_error)
7472  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7473  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 852, __pyx_L1_error)
7474  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7475  if (__pyx_t_6) {
7476  (__pyx_v_f[0]) = 90;
7477  (__pyx_v_f[1]) = 0x67;
7478  __pyx_v_f = (__pyx_v_f + 1);
7479  goto __pyx_L15;
7480  }
7481 
7482  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":853
7483  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7484  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7485  * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
7486  * else:
7487  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7488  */
7489  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 853, __pyx_L1_error)
7490  __Pyx_GOTREF(__pyx_t_4);
7491  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 853, __pyx_L1_error)
7492  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7493  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 853, __pyx_L1_error)
7494  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7495  if (likely(__pyx_t_6)) {
7496  (__pyx_v_f[0]) = 79;
7497  goto __pyx_L15;
7498  }
7499 
7500  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
7501  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7502  * else:
7503  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
7504  * f += 1
7505  * else:
7506  */
7507  /*else*/ {
7508  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 855, __pyx_L1_error)
7509  __Pyx_GOTREF(__pyx_t_3);
7510  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 855, __pyx_L1_error)
7511  __Pyx_GOTREF(__pyx_t_4);
7512  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7513  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7514  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7515  __PYX_ERR(3, 855, __pyx_L1_error)
7516  }
7517  __pyx_L15:;
7518 
7519  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
7520  * else:
7521  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7522  * f += 1 # <<<<<<<<<<<<<<
7523  * else:
7524  * # Cython ignores struct boundary information ("T{...}"),
7525  */
7526  __pyx_v_f = (__pyx_v_f + 1);
7527 
7528  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
7529  * offset[0] += child.itemsize
7530  *
7531  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7532  * t = child.type_num
7533  * if end - f < 5:
7534  */
7535  goto __pyx_L13;
7536  }
7537 
7538  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":860
7539  * # Cython ignores struct boundary information ("T{...}"),
7540  * # so don't output it
7541  * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
7542  * return f
7543  *
7544  */
7545  /*else*/ {
7546  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(3, 860, __pyx_L1_error)
7547  __pyx_v_f = __pyx_t_9;
7548  }
7549  __pyx_L13:;
7550 
7551  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
7552  * cdef tuple fields
7553  *
7554  * for childname in descr.names: # <<<<<<<<<<<<<<
7555  * fields = descr.fields[childname]
7556  * child, new_offset = fields
7557  */
7558  }
7559  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7560 
7561  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":861
7562  * # so don't output it
7563  * f = _util_dtypestring(child, f, end, offset)
7564  * return f # <<<<<<<<<<<<<<
7565  *
7566  *
7567  */
7568  __pyx_r = __pyx_v_f;
7569  goto __pyx_L0;
7570 
7571  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
7572  * return ()
7573  *
7574  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
7575  * # Recursive utility function used in __getbuffer__ to get format
7576  * # string. The new location in the format string is returned.
7577  */
7578 
7579  /* function exit code */
7580  __pyx_L1_error:;
7581  __Pyx_XDECREF(__pyx_t_1);
7582  __Pyx_XDECREF(__pyx_t_3);
7583  __Pyx_XDECREF(__pyx_t_4);
7584  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
7585  __pyx_r = NULL;
7586  __pyx_L0:;
7587  __Pyx_XDECREF((PyObject *)__pyx_v_child);
7588  __Pyx_XDECREF(__pyx_v_fields);
7589  __Pyx_XDECREF(__pyx_v_childname);
7590  __Pyx_XDECREF(__pyx_v_new_offset);
7591  __Pyx_XDECREF(__pyx_v_t);
7592  __Pyx_RefNannyFinishContext();
7593  return __pyx_r;
7594 }
7595 
7596 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
7597  *
7598  *
7599  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7600  * cdef PyObject* baseptr
7601  * if base is None:
7602  */
7603 
7604 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7605  PyObject *__pyx_v_baseptr;
7606  __Pyx_RefNannyDeclarations
7607  int __pyx_t_1;
7608  int __pyx_t_2;
7609  __Pyx_RefNannySetupContext("set_array_base", 0);
7610 
7611  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979
7612  * cdef inline void set_array_base(ndarray arr, object base):
7613  * cdef PyObject* baseptr
7614  * if base is None: # <<<<<<<<<<<<<<
7615  * baseptr = NULL
7616  * else:
7617  */
7618  __pyx_t_1 = (__pyx_v_base == Py_None);
7619  __pyx_t_2 = (__pyx_t_1 != 0);
7620  if (__pyx_t_2) {
7621 
7622  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
7623  * cdef PyObject* baseptr
7624  * if base is None:
7625  * baseptr = NULL # <<<<<<<<<<<<<<
7626  * else:
7627  * Py_INCREF(base) # important to do this before decref below!
7628  */
7629  __pyx_v_baseptr = NULL;
7630 
7631  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979
7632  * cdef inline void set_array_base(ndarray arr, object base):
7633  * cdef PyObject* baseptr
7634  * if base is None: # <<<<<<<<<<<<<<
7635  * baseptr = NULL
7636  * else:
7637  */
7638  goto __pyx_L3;
7639  }
7640 
7641  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":982
7642  * baseptr = NULL
7643  * else:
7644  * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
7645  * baseptr = <PyObject*>base
7646  * Py_XDECREF(arr.base)
7647  */
7648  /*else*/ {
7649  Py_INCREF(__pyx_v_base);
7650 
7651  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":983
7652  * else:
7653  * Py_INCREF(base) # important to do this before decref below!
7654  * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
7655  * Py_XDECREF(arr.base)
7656  * arr.base = baseptr
7657  */
7658  __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
7659  }
7660  __pyx_L3:;
7661 
7662  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":984
7663  * Py_INCREF(base) # important to do this before decref below!
7664  * baseptr = <PyObject*>base
7665  * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
7666  * arr.base = baseptr
7667  *
7668  */
7669  Py_XDECREF(__pyx_v_arr->base);
7670 
7671  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":985
7672  * baseptr = <PyObject*>base
7673  * Py_XDECREF(arr.base)
7674  * arr.base = baseptr # <<<<<<<<<<<<<<
7675  *
7676  * cdef inline object get_array_base(ndarray arr):
7677  */
7678  __pyx_v_arr->base = __pyx_v_baseptr;
7679 
7680  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
7681  *
7682  *
7683  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7684  * cdef PyObject* baseptr
7685  * if base is None:
7686  */
7687 
7688  /* function exit code */
7689  __Pyx_RefNannyFinishContext();
7690 }
7691 
7692 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":987
7693  * arr.base = baseptr
7694  *
7695  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7696  * if arr.base is NULL:
7697  * return None
7698  */
7699 
7700 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7701  PyObject *__pyx_r = NULL;
7702  __Pyx_RefNannyDeclarations
7703  int __pyx_t_1;
7704  __Pyx_RefNannySetupContext("get_array_base", 0);
7705 
7706  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":988
7707  *
7708  * cdef inline object get_array_base(ndarray arr):
7709  * if arr.base is NULL: # <<<<<<<<<<<<<<
7710  * return None
7711  * else:
7712  */
7713  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
7714  if (__pyx_t_1) {
7715 
7716  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":989
7717  * cdef inline object get_array_base(ndarray arr):
7718  * if arr.base is NULL:
7719  * return None # <<<<<<<<<<<<<<
7720  * else:
7721  * return <object>arr.base
7722  */
7723  __Pyx_XDECREF(__pyx_r);
7724  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7725  goto __pyx_L0;
7726 
7727  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":988
7728  *
7729  * cdef inline object get_array_base(ndarray arr):
7730  * if arr.base is NULL: # <<<<<<<<<<<<<<
7731  * return None
7732  * else:
7733  */
7734  }
7735 
7736  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":991
7737  * return None
7738  * else:
7739  * return <object>arr.base # <<<<<<<<<<<<<<
7740  *
7741  *
7742  */
7743  /*else*/ {
7744  __Pyx_XDECREF(__pyx_r);
7745  __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
7746  __pyx_r = ((PyObject *)__pyx_v_arr->base);
7747  goto __pyx_L0;
7748  }
7749 
7750  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":987
7751  * arr.base = baseptr
7752  *
7753  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7754  * if arr.base is NULL:
7755  * return None
7756  */
7757 
7758  /* function exit code */
7759  __pyx_L0:;
7760  __Pyx_XGIVEREF(__pyx_r);
7761  __Pyx_RefNannyFinishContext();
7762  return __pyx_r;
7763 }
7764 
7765 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":996
7766  * # Versions of the import_* functions which are more suitable for
7767  * # Cython code.
7768  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7769  * try:
7770  * _import_array()
7771  */
7772 
7773 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
7774  int __pyx_r;
7775  __Pyx_RefNannyDeclarations
7776  PyObject *__pyx_t_1 = NULL;
7777  PyObject *__pyx_t_2 = NULL;
7778  PyObject *__pyx_t_3 = NULL;
7779  int __pyx_t_4;
7780  PyObject *__pyx_t_5 = NULL;
7781  PyObject *__pyx_t_6 = NULL;
7782  PyObject *__pyx_t_7 = NULL;
7783  PyObject *__pyx_t_8 = NULL;
7784  __Pyx_RefNannySetupContext("import_array", 0);
7785 
7786  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
7787  * # Cython code.
7788  * cdef inline int import_array() except -1:
7789  * try: # <<<<<<<<<<<<<<
7790  * _import_array()
7791  * except Exception:
7792  */
7793  {
7794  __Pyx_PyThreadState_declare
7795  __Pyx_PyThreadState_assign
7796  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7797  __Pyx_XGOTREF(__pyx_t_1);
7798  __Pyx_XGOTREF(__pyx_t_2);
7799  __Pyx_XGOTREF(__pyx_t_3);
7800  /*try:*/ {
7801 
7802  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":998
7803  * cdef inline int import_array() except -1:
7804  * try:
7805  * _import_array() # <<<<<<<<<<<<<<
7806  * except Exception:
7807  * raise ImportError("numpy.core.multiarray failed to import")
7808  */
7809  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 998, __pyx_L3_error)
7810 
7811  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
7812  * # Cython code.
7813  * cdef inline int import_array() except -1:
7814  * try: # <<<<<<<<<<<<<<
7815  * _import_array()
7816  * except Exception:
7817  */
7818  }
7819  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7820  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7821  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7822  goto __pyx_L8_try_end;
7823  __pyx_L3_error:;
7824 
7825  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":999
7826  * try:
7827  * _import_array()
7828  * except Exception: # <<<<<<<<<<<<<<
7829  * raise ImportError("numpy.core.multiarray failed to import")
7830  *
7831  */
7832  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7833  if (__pyx_t_4) {
7834  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7835  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 999, __pyx_L5_except_error)
7836  __Pyx_GOTREF(__pyx_t_5);
7837  __Pyx_GOTREF(__pyx_t_6);
7838  __Pyx_GOTREF(__pyx_t_7);
7839 
7840  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1000
7841  * _import_array()
7842  * except Exception:
7843  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
7844  *
7845  * cdef inline int import_umath() except -1:
7846  */
7847  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1000, __pyx_L5_except_error)
7848  __Pyx_GOTREF(__pyx_t_8);
7849  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7850  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7851  __PYX_ERR(3, 1000, __pyx_L5_except_error)
7852  }
7853  goto __pyx_L5_except_error;
7854  __pyx_L5_except_error:;
7855 
7856  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
7857  * # Cython code.
7858  * cdef inline int import_array() except -1:
7859  * try: # <<<<<<<<<<<<<<
7860  * _import_array()
7861  * except Exception:
7862  */
7863  __Pyx_XGIVEREF(__pyx_t_1);
7864  __Pyx_XGIVEREF(__pyx_t_2);
7865  __Pyx_XGIVEREF(__pyx_t_3);
7866  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7867  goto __pyx_L1_error;
7868  __pyx_L8_try_end:;
7869  }
7870 
7871  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":996
7872  * # Versions of the import_* functions which are more suitable for
7873  * # Cython code.
7874  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7875  * try:
7876  * _import_array()
7877  */
7878 
7879  /* function exit code */
7880  __pyx_r = 0;
7881  goto __pyx_L0;
7882  __pyx_L1_error:;
7883  __Pyx_XDECREF(__pyx_t_5);
7884  __Pyx_XDECREF(__pyx_t_6);
7885  __Pyx_XDECREF(__pyx_t_7);
7886  __Pyx_XDECREF(__pyx_t_8);
7887  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7888  __pyx_r = -1;
7889  __pyx_L0:;
7890  __Pyx_RefNannyFinishContext();
7891  return __pyx_r;
7892 }
7893 
7894 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1002
7895  * raise ImportError("numpy.core.multiarray failed to import")
7896  *
7897  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7898  * try:
7899  * _import_umath()
7900  */
7901 
7902 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
7903  int __pyx_r;
7904  __Pyx_RefNannyDeclarations
7905  PyObject *__pyx_t_1 = NULL;
7906  PyObject *__pyx_t_2 = NULL;
7907  PyObject *__pyx_t_3 = NULL;
7908  int __pyx_t_4;
7909  PyObject *__pyx_t_5 = NULL;
7910  PyObject *__pyx_t_6 = NULL;
7911  PyObject *__pyx_t_7 = NULL;
7912  PyObject *__pyx_t_8 = NULL;
7913  __Pyx_RefNannySetupContext("import_umath", 0);
7914 
7915  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1003
7916  *
7917  * cdef inline int import_umath() except -1:
7918  * try: # <<<<<<<<<<<<<<
7919  * _import_umath()
7920  * except Exception:
7921  */
7922  {
7923  __Pyx_PyThreadState_declare
7924  __Pyx_PyThreadState_assign
7925  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7926  __Pyx_XGOTREF(__pyx_t_1);
7927  __Pyx_XGOTREF(__pyx_t_2);
7928  __Pyx_XGOTREF(__pyx_t_3);
7929  /*try:*/ {
7930 
7931  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1004
7932  * cdef inline int import_umath() except -1:
7933  * try:
7934  * _import_umath() # <<<<<<<<<<<<<<
7935  * except Exception:
7936  * raise ImportError("numpy.core.umath failed to import")
7937  */
7938  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1004, __pyx_L3_error)
7939 
7940  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1003
7941  *
7942  * cdef inline int import_umath() except -1:
7943  * try: # <<<<<<<<<<<<<<
7944  * _import_umath()
7945  * except Exception:
7946  */
7947  }
7948  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7949  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7950  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7951  goto __pyx_L8_try_end;
7952  __pyx_L3_error:;
7953 
7954  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1005
7955  * try:
7956  * _import_umath()
7957  * except Exception: # <<<<<<<<<<<<<<
7958  * raise ImportError("numpy.core.umath failed to import")
7959  *
7960  */
7961  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7962  if (__pyx_t_4) {
7963  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7964  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1005, __pyx_L5_except_error)
7965  __Pyx_GOTREF(__pyx_t_5);
7966  __Pyx_GOTREF(__pyx_t_6);
7967  __Pyx_GOTREF(__pyx_t_7);
7968 
7969  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1006
7970  * _import_umath()
7971  * except Exception:
7972  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7973  *
7974  * cdef inline int import_ufunc() except -1:
7975  */
7976  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1006, __pyx_L5_except_error)
7977  __Pyx_GOTREF(__pyx_t_8);
7978  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7979  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7980  __PYX_ERR(3, 1006, __pyx_L5_except_error)
7981  }
7982  goto __pyx_L5_except_error;
7983  __pyx_L5_except_error:;
7984 
7985  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1003
7986  *
7987  * cdef inline int import_umath() except -1:
7988  * try: # <<<<<<<<<<<<<<
7989  * _import_umath()
7990  * except Exception:
7991  */
7992  __Pyx_XGIVEREF(__pyx_t_1);
7993  __Pyx_XGIVEREF(__pyx_t_2);
7994  __Pyx_XGIVEREF(__pyx_t_3);
7995  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7996  goto __pyx_L1_error;
7997  __pyx_L8_try_end:;
7998  }
7999 
8000  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1002
8001  * raise ImportError("numpy.core.multiarray failed to import")
8002  *
8003  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8004  * try:
8005  * _import_umath()
8006  */
8007 
8008  /* function exit code */
8009  __pyx_r = 0;
8010  goto __pyx_L0;
8011  __pyx_L1_error:;
8012  __Pyx_XDECREF(__pyx_t_5);
8013  __Pyx_XDECREF(__pyx_t_6);
8014  __Pyx_XDECREF(__pyx_t_7);
8015  __Pyx_XDECREF(__pyx_t_8);
8016  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8017  __pyx_r = -1;
8018  __pyx_L0:;
8019  __Pyx_RefNannyFinishContext();
8020  return __pyx_r;
8021 }
8022 
8023 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1008
8024  * raise ImportError("numpy.core.umath failed to import")
8025  *
8026  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8027  * try:
8028  * _import_umath()
8029  */
8030 
8031 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
8032  int __pyx_r;
8033  __Pyx_RefNannyDeclarations
8034  PyObject *__pyx_t_1 = NULL;
8035  PyObject *__pyx_t_2 = NULL;
8036  PyObject *__pyx_t_3 = NULL;
8037  int __pyx_t_4;
8038  PyObject *__pyx_t_5 = NULL;
8039  PyObject *__pyx_t_6 = NULL;
8040  PyObject *__pyx_t_7 = NULL;
8041  PyObject *__pyx_t_8 = NULL;
8042  __Pyx_RefNannySetupContext("import_ufunc", 0);
8043 
8044  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1009
8045  *
8046  * cdef inline int import_ufunc() except -1:
8047  * try: # <<<<<<<<<<<<<<
8048  * _import_umath()
8049  * except Exception:
8050  */
8051  {
8052  __Pyx_PyThreadState_declare
8053  __Pyx_PyThreadState_assign
8054  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8055  __Pyx_XGOTREF(__pyx_t_1);
8056  __Pyx_XGOTREF(__pyx_t_2);
8057  __Pyx_XGOTREF(__pyx_t_3);
8058  /*try:*/ {
8059 
8060  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1010
8061  * cdef inline int import_ufunc() except -1:
8062  * try:
8063  * _import_umath() # <<<<<<<<<<<<<<
8064  * except Exception:
8065  * raise ImportError("numpy.core.umath failed to import")
8066  */
8067  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1010, __pyx_L3_error)
8068 
8069  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1009
8070  *
8071  * cdef inline int import_ufunc() except -1:
8072  * try: # <<<<<<<<<<<<<<
8073  * _import_umath()
8074  * except Exception:
8075  */
8076  }
8077  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8078  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8079  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8080  goto __pyx_L8_try_end;
8081  __pyx_L3_error:;
8082 
8083  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1011
8084  * try:
8085  * _import_umath()
8086  * except Exception: # <<<<<<<<<<<<<<
8087  * raise ImportError("numpy.core.umath failed to import")
8088  */
8089  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8090  if (__pyx_t_4) {
8091  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8092  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1011, __pyx_L5_except_error)
8093  __Pyx_GOTREF(__pyx_t_5);
8094  __Pyx_GOTREF(__pyx_t_6);
8095  __Pyx_GOTREF(__pyx_t_7);
8096 
8097  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1012
8098  * _import_umath()
8099  * except Exception:
8100  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8101  */
8102  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1012, __pyx_L5_except_error)
8103  __Pyx_GOTREF(__pyx_t_8);
8104  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8105  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8106  __PYX_ERR(3, 1012, __pyx_L5_except_error)
8107  }
8108  goto __pyx_L5_except_error;
8109  __pyx_L5_except_error:;
8110 
8111  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1009
8112  *
8113  * cdef inline int import_ufunc() except -1:
8114  * try: # <<<<<<<<<<<<<<
8115  * _import_umath()
8116  * except Exception:
8117  */
8118  __Pyx_XGIVEREF(__pyx_t_1);
8119  __Pyx_XGIVEREF(__pyx_t_2);
8120  __Pyx_XGIVEREF(__pyx_t_3);
8121  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8122  goto __pyx_L1_error;
8123  __pyx_L8_try_end:;
8124  }
8125 
8126  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1008
8127  * raise ImportError("numpy.core.umath failed to import")
8128  *
8129  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8130  * try:
8131  * _import_umath()
8132  */
8133 
8134  /* function exit code */
8135  __pyx_r = 0;
8136  goto __pyx_L0;
8137  __pyx_L1_error:;
8138  __Pyx_XDECREF(__pyx_t_5);
8139  __Pyx_XDECREF(__pyx_t_6);
8140  __Pyx_XDECREF(__pyx_t_7);
8141  __Pyx_XDECREF(__pyx_t_8);
8142  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8143  __pyx_r = -1;
8144  __pyx_L0:;
8145  __Pyx_RefNannyFinishContext();
8146  return __pyx_r;
8147 }
8148 
8149 /* "View.MemoryView":121
8150  * cdef bint dtype_is_object
8151  *
8152  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8153  * mode="c", bint allocate_buffer=True):
8154  *
8155  */
8156 
8157 /* Python wrapper */
8158 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8159 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8160  PyObject *__pyx_v_shape = 0;
8161  Py_ssize_t __pyx_v_itemsize;
8162  PyObject *__pyx_v_format = 0;
8163  PyObject *__pyx_v_mode = 0;
8164  int __pyx_v_allocate_buffer;
8165  int __pyx_r;
8166  __Pyx_RefNannyDeclarations
8167  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8168  {
8169  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
8170  PyObject* values[5] = {0,0,0,0,0};
8171  values[3] = ((PyObject *)__pyx_n_s_c);
8172  if (unlikely(__pyx_kwds)) {
8173  Py_ssize_t kw_args;
8174  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8175  switch (pos_args) {
8176  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8177  CYTHON_FALLTHROUGH;
8178  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8179  CYTHON_FALLTHROUGH;
8180  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8181  CYTHON_FALLTHROUGH;
8182  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8183  CYTHON_FALLTHROUGH;
8184  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8185  CYTHON_FALLTHROUGH;
8186  case 0: break;
8187  default: goto __pyx_L5_argtuple_error;
8188  }
8189  kw_args = PyDict_Size(__pyx_kwds);
8190  switch (pos_args) {
8191  case 0:
8192  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8193  else goto __pyx_L5_argtuple_error;
8194  CYTHON_FALLTHROUGH;
8195  case 1:
8196  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8197  else {
8198  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 121, __pyx_L3_error)
8199  }
8200  CYTHON_FALLTHROUGH;
8201  case 2:
8202  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8203  else {
8204  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 121, __pyx_L3_error)
8205  }
8206  CYTHON_FALLTHROUGH;
8207  case 3:
8208  if (kw_args > 0) {
8209  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8210  if (value) { values[3] = value; kw_args--; }
8211  }
8212  CYTHON_FALLTHROUGH;
8213  case 4:
8214  if (kw_args > 0) {
8215  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8216  if (value) { values[4] = value; kw_args--; }
8217  }
8218  }
8219  if (unlikely(kw_args > 0)) {
8220  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 121, __pyx_L3_error)
8221  }
8222  } else {
8223  switch (PyTuple_GET_SIZE(__pyx_args)) {
8224  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8225  CYTHON_FALLTHROUGH;
8226  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8227  CYTHON_FALLTHROUGH;
8228  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8229  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8230  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8231  break;
8232  default: goto __pyx_L5_argtuple_error;
8233  }
8234  }
8235  __pyx_v_shape = ((PyObject*)values[0]);
8236  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error)
8237  __pyx_v_format = values[2];
8238  __pyx_v_mode = values[3];
8239  if (values[4]) {
8240  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
8241  } else {
8242 
8243  /* "View.MemoryView":122
8244  *
8245  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
8246  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
8247  *
8248  * cdef int idx
8249  */
8250  __pyx_v_allocate_buffer = ((int)1);
8251  }
8252  }
8253  goto __pyx_L4_argument_unpacking_done;
8254  __pyx_L5_argtuple_error:;
8255  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 121, __pyx_L3_error)
8256  __pyx_L3_error:;
8257  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8258  __Pyx_RefNannyFinishContext();
8259  return -1;
8260  __pyx_L4_argument_unpacking_done:;
8261  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 121, __pyx_L1_error)
8262  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8263  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 121, __pyx_L1_error)
8264  }
8265  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
8266 
8267  /* "View.MemoryView":121
8268  * cdef bint dtype_is_object
8269  *
8270  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8271  * mode="c", bint allocate_buffer=True):
8272  *
8273  */
8274 
8275  /* function exit code */
8276  goto __pyx_L0;
8277  __pyx_L1_error:;
8278  __pyx_r = -1;
8279  __pyx_L0:;
8280  __Pyx_RefNannyFinishContext();
8281  return __pyx_r;
8282 }
8283 
8284 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
8285  int __pyx_v_idx;
8286  Py_ssize_t __pyx_v_i;
8287  Py_ssize_t __pyx_v_dim;
8288  PyObject **__pyx_v_p;
8289  char __pyx_v_order;
8290  int __pyx_r;
8291  __Pyx_RefNannyDeclarations
8292  Py_ssize_t __pyx_t_1;
8293  int __pyx_t_2;
8294  PyObject *__pyx_t_3 = NULL;
8295  int __pyx_t_4;
8296  PyObject *__pyx_t_5 = NULL;
8297  char *__pyx_t_6;
8298  int __pyx_t_7;
8299  Py_ssize_t __pyx_t_8;
8300  PyObject *__pyx_t_9 = NULL;
8301  PyObject *__pyx_t_10 = NULL;
8302  Py_ssize_t __pyx_t_11;
8303  __Pyx_RefNannySetupContext("__cinit__", 0);
8304  __Pyx_INCREF(__pyx_v_format);
8305 
8306  /* "View.MemoryView":128
8307  * cdef PyObject **p
8308  *
8309  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
8310  * self.itemsize = itemsize
8311  *
8312  */
8313  if (unlikely(__pyx_v_shape == Py_None)) {
8314  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8315  __PYX_ERR(1, 128, __pyx_L1_error)
8316  }
8317  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 128, __pyx_L1_error)
8318  __pyx_v_self->ndim = ((int)__pyx_t_1);
8319 
8320  /* "View.MemoryView":129
8321  *
8322  * self.ndim = <int> len(shape)
8323  * self.itemsize = itemsize # <<<<<<<<<<<<<<
8324  *
8325  * if not self.ndim:
8326  */
8327  __pyx_v_self->itemsize = __pyx_v_itemsize;
8328 
8329  /* "View.MemoryView":131
8330  * self.itemsize = itemsize
8331  *
8332  * if not self.ndim: # <<<<<<<<<<<<<<
8333  * raise ValueError("Empty shape tuple for cython.array")
8334  *
8335  */
8336  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8337  if (unlikely(__pyx_t_2)) {
8338 
8339  /* "View.MemoryView":132
8340  *
8341  * if not self.ndim:
8342  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
8343  *
8344  * if itemsize <= 0:
8345  */
8346  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 132, __pyx_L1_error)
8347  __Pyx_GOTREF(__pyx_t_3);
8348  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8349  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8350  __PYX_ERR(1, 132, __pyx_L1_error)
8351 
8352  /* "View.MemoryView":131
8353  * self.itemsize = itemsize
8354  *
8355  * if not self.ndim: # <<<<<<<<<<<<<<
8356  * raise ValueError("Empty shape tuple for cython.array")
8357  *
8358  */
8359  }
8360 
8361  /* "View.MemoryView":134
8362  * raise ValueError("Empty shape tuple for cython.array")
8363  *
8364  * if itemsize <= 0: # <<<<<<<<<<<<<<
8365  * raise ValueError("itemsize <= 0 for cython.array")
8366  *
8367  */
8368  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8369  if (unlikely(__pyx_t_2)) {
8370 
8371  /* "View.MemoryView":135
8372  *
8373  * if itemsize <= 0:
8374  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
8375  *
8376  * if not isinstance(format, bytes):
8377  */
8378  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 135, __pyx_L1_error)
8379  __Pyx_GOTREF(__pyx_t_3);
8380  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8381  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8382  __PYX_ERR(1, 135, __pyx_L1_error)
8383 
8384  /* "View.MemoryView":134
8385  * raise ValueError("Empty shape tuple for cython.array")
8386  *
8387  * if itemsize <= 0: # <<<<<<<<<<<<<<
8388  * raise ValueError("itemsize <= 0 for cython.array")
8389  *
8390  */
8391  }
8392 
8393  /* "View.MemoryView":137
8394  * raise ValueError("itemsize <= 0 for cython.array")
8395  *
8396  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8397  * format = format.encode('ASCII')
8398  * self._format = format # keep a reference to the byte string
8399  */
8400  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8401  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8402  if (__pyx_t_4) {
8403 
8404  /* "View.MemoryView":138
8405  *
8406  * if not isinstance(format, bytes):
8407  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
8408  * self._format = format # keep a reference to the byte string
8409  * self.format = self._format
8410  */
8411  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 138, __pyx_L1_error)
8412  __Pyx_GOTREF(__pyx_t_3);
8413  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 138, __pyx_L1_error)
8414  __Pyx_GOTREF(__pyx_t_5);
8415  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8416  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
8417  __pyx_t_5 = 0;
8418 
8419  /* "View.MemoryView":137
8420  * raise ValueError("itemsize <= 0 for cython.array")
8421  *
8422  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8423  * format = format.encode('ASCII')
8424  * self._format = format # keep a reference to the byte string
8425  */
8426  }
8427 
8428  /* "View.MemoryView":139
8429  * if not isinstance(format, bytes):
8430  * format = format.encode('ASCII')
8431  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
8432  * self.format = self._format
8433  *
8434  */
8435  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 139, __pyx_L1_error)
8436  __pyx_t_5 = __pyx_v_format;
8437  __Pyx_INCREF(__pyx_t_5);
8438  __Pyx_GIVEREF(__pyx_t_5);
8439  __Pyx_GOTREF(__pyx_v_self->_format);
8440  __Pyx_DECREF(__pyx_v_self->_format);
8441  __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
8442  __pyx_t_5 = 0;
8443 
8444  /* "View.MemoryView":140
8445  * format = format.encode('ASCII')
8446  * self._format = format # keep a reference to the byte string
8447  * self.format = self._format # <<<<<<<<<<<<<<
8448  *
8449  *
8450  */
8451  if (unlikely(__pyx_v_self->_format == Py_None)) {
8452  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
8453  __PYX_ERR(1, 140, __pyx_L1_error)
8454  }
8455  __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 140, __pyx_L1_error)
8456  __pyx_v_self->format = __pyx_t_6;
8457 
8458  /* "View.MemoryView":143
8459  *
8460  *
8461  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
8462  * self._strides = self._shape + self.ndim
8463  *
8464  */
8465  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8466 
8467  /* "View.MemoryView":144
8468  *
8469  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
8470  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
8471  *
8472  * if not self._shape:
8473  */
8474  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8475 
8476  /* "View.MemoryView":146
8477  * self._strides = self._shape + self.ndim
8478  *
8479  * if not self._shape: # <<<<<<<<<<<<<<
8480  * raise MemoryError("unable to allocate shape and strides.")
8481  *
8482  */
8483  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8484  if (unlikely(__pyx_t_4)) {
8485 
8486  /* "View.MemoryView":147
8487  *
8488  * if not self._shape:
8489  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
8490  *
8491  *
8492  */
8493  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 147, __pyx_L1_error)
8494  __Pyx_GOTREF(__pyx_t_5);
8495  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
8496  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8497  __PYX_ERR(1, 147, __pyx_L1_error)
8498 
8499  /* "View.MemoryView":146
8500  * self._strides = self._shape + self.ndim
8501  *
8502  * if not self._shape: # <<<<<<<<<<<<<<
8503  * raise MemoryError("unable to allocate shape and strides.")
8504  *
8505  */
8506  }
8507 
8508  /* "View.MemoryView":150
8509  *
8510  *
8511  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8512  * if dim <= 0:
8513  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8514  */
8515  __pyx_t_7 = 0;
8516  __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
8517  for (;;) {
8518  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
8519  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8520  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 150, __pyx_L1_error)
8521  #else
8522  __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 150, __pyx_L1_error)
8523  __Pyx_GOTREF(__pyx_t_3);
8524  #endif
8525  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 150, __pyx_L1_error)
8526  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8527  __pyx_v_dim = __pyx_t_8;
8528  __pyx_v_idx = __pyx_t_7;
8529  __pyx_t_7 = (__pyx_t_7 + 1);
8530 
8531  /* "View.MemoryView":151
8532  *
8533  * for idx, dim in enumerate(shape):
8534  * if dim <= 0: # <<<<<<<<<<<<<<
8535  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8536  * self._shape[idx] = dim
8537  */
8538  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8539  if (unlikely(__pyx_t_4)) {
8540 
8541  /* "View.MemoryView":152
8542  * for idx, dim in enumerate(shape):
8543  * if dim <= 0:
8544  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
8545  * self._shape[idx] = dim
8546  *
8547  */
8548  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 152, __pyx_L1_error)
8549  __Pyx_GOTREF(__pyx_t_3);
8550  __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error)
8551  __Pyx_GOTREF(__pyx_t_9);
8552  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error)
8553  __Pyx_GOTREF(__pyx_t_10);
8554  __Pyx_GIVEREF(__pyx_t_3);
8555  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
8556  __Pyx_GIVEREF(__pyx_t_9);
8557  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
8558  __pyx_t_3 = 0;
8559  __pyx_t_9 = 0;
8560  __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error)
8561  __Pyx_GOTREF(__pyx_t_9);
8562  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8563  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error)
8564  __Pyx_GOTREF(__pyx_t_10);
8565  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8566  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8567  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8568  __PYX_ERR(1, 152, __pyx_L1_error)
8569 
8570  /* "View.MemoryView":151
8571  *
8572  * for idx, dim in enumerate(shape):
8573  * if dim <= 0: # <<<<<<<<<<<<<<
8574  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8575  * self._shape[idx] = dim
8576  */
8577  }
8578 
8579  /* "View.MemoryView":153
8580  * if dim <= 0:
8581  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8582  * self._shape[idx] = dim # <<<<<<<<<<<<<<
8583  *
8584  * cdef char order
8585  */
8586  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8587 
8588  /* "View.MemoryView":150
8589  *
8590  *
8591  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8592  * if dim <= 0:
8593  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8594  */
8595  }
8596  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8597 
8598  /* "View.MemoryView":156
8599  *
8600  * cdef char order
8601  * if mode == 'fortran': # <<<<<<<<<<<<<<
8602  * order = b'F'
8603  * self.mode = u'fortran'
8604  */
8605  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 156, __pyx_L1_error)
8606  if (__pyx_t_4) {
8607 
8608  /* "View.MemoryView":157
8609  * cdef char order
8610  * if mode == 'fortran':
8611  * order = b'F' # <<<<<<<<<<<<<<
8612  * self.mode = u'fortran'
8613  * elif mode == 'c':
8614  */
8615  __pyx_v_order = 'F';
8616 
8617  /* "View.MemoryView":158
8618  * if mode == 'fortran':
8619  * order = b'F'
8620  * self.mode = u'fortran' # <<<<<<<<<<<<<<
8621  * elif mode == 'c':
8622  * order = b'C'
8623  */
8624  __Pyx_INCREF(__pyx_n_u_fortran);
8625  __Pyx_GIVEREF(__pyx_n_u_fortran);
8626  __Pyx_GOTREF(__pyx_v_self->mode);
8627  __Pyx_DECREF(__pyx_v_self->mode);
8628  __pyx_v_self->mode = __pyx_n_u_fortran;
8629 
8630  /* "View.MemoryView":156
8631  *
8632  * cdef char order
8633  * if mode == 'fortran': # <<<<<<<<<<<<<<
8634  * order = b'F'
8635  * self.mode = u'fortran'
8636  */
8637  goto __pyx_L10;
8638  }
8639 
8640  /* "View.MemoryView":159
8641  * order = b'F'
8642  * self.mode = u'fortran'
8643  * elif mode == 'c': # <<<<<<<<<<<<<<
8644  * order = b'C'
8645  * self.mode = u'c'
8646  */
8647  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 159, __pyx_L1_error)
8648  if (likely(__pyx_t_4)) {
8649 
8650  /* "View.MemoryView":160
8651  * self.mode = u'fortran'
8652  * elif mode == 'c':
8653  * order = b'C' # <<<<<<<<<<<<<<
8654  * self.mode = u'c'
8655  * else:
8656  */
8657  __pyx_v_order = 'C';
8658 
8659  /* "View.MemoryView":161
8660  * elif mode == 'c':
8661  * order = b'C'
8662  * self.mode = u'c' # <<<<<<<<<<<<<<
8663  * else:
8664  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8665  */
8666  __Pyx_INCREF(__pyx_n_u_c);
8667  __Pyx_GIVEREF(__pyx_n_u_c);
8668  __Pyx_GOTREF(__pyx_v_self->mode);
8669  __Pyx_DECREF(__pyx_v_self->mode);
8670  __pyx_v_self->mode = __pyx_n_u_c;
8671 
8672  /* "View.MemoryView":159
8673  * order = b'F'
8674  * self.mode = u'fortran'
8675  * elif mode == 'c': # <<<<<<<<<<<<<<
8676  * order = b'C'
8677  * self.mode = u'c'
8678  */
8679  goto __pyx_L10;
8680  }
8681 
8682  /* "View.MemoryView":163
8683  * self.mode = u'c'
8684  * else:
8685  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
8686  *
8687  * self.len = fill_contig_strides_array(self._shape, self._strides,
8688  */
8689  /*else*/ {
8690  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error)
8691  __Pyx_GOTREF(__pyx_t_5);
8692  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 163, __pyx_L1_error)
8693  __Pyx_GOTREF(__pyx_t_10);
8694  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8695  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8696  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8697  __PYX_ERR(1, 163, __pyx_L1_error)
8698  }
8699  __pyx_L10:;
8700 
8701  /* "View.MemoryView":165
8702  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8703  *
8704  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
8705  * itemsize, self.ndim, order)
8706  *
8707  */
8708  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
8709 
8710  /* "View.MemoryView":168
8711  * itemsize, self.ndim, order)
8712  *
8713  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
8714  * self.dtype_is_object = format == b'O'
8715  * if allocate_buffer:
8716  */
8717  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8718 
8719  /* "View.MemoryView":169
8720  *
8721  * self.free_data = allocate_buffer
8722  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
8723  * if allocate_buffer:
8724  *
8725  */
8726  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 169, __pyx_L1_error)
8727  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 169, __pyx_L1_error)
8728  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8729  __pyx_v_self->dtype_is_object = __pyx_t_4;
8730 
8731  /* "View.MemoryView":170
8732  * self.free_data = allocate_buffer
8733  * self.dtype_is_object = format == b'O'
8734  * if allocate_buffer: # <<<<<<<<<<<<<<
8735  *
8736  *
8737  */
8738  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8739  if (__pyx_t_4) {
8740 
8741  /* "View.MemoryView":173
8742  *
8743  *
8744  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
8745  * if not self.data:
8746  * raise MemoryError("unable to allocate array data.")
8747  */
8748  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
8749 
8750  /* "View.MemoryView":174
8751  *
8752  * self.data = <char *>malloc(self.len)
8753  * if not self.data: # <<<<<<<<<<<<<<
8754  * raise MemoryError("unable to allocate array data.")
8755  *
8756  */
8757  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8758  if (unlikely(__pyx_t_4)) {
8759 
8760  /* "View.MemoryView":175
8761  * self.data = <char *>malloc(self.len)
8762  * if not self.data:
8763  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
8764  *
8765  * if self.dtype_is_object:
8766  */
8767  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 175, __pyx_L1_error)
8768  __Pyx_GOTREF(__pyx_t_10);
8769  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8770  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8771  __PYX_ERR(1, 175, __pyx_L1_error)
8772 
8773  /* "View.MemoryView":174
8774  *
8775  * self.data = <char *>malloc(self.len)
8776  * if not self.data: # <<<<<<<<<<<<<<
8777  * raise MemoryError("unable to allocate array data.")
8778  *
8779  */
8780  }
8781 
8782  /* "View.MemoryView":177
8783  * raise MemoryError("unable to allocate array data.")
8784  *
8785  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8786  * p = <PyObject **> self.data
8787  * for i in range(self.len / itemsize):
8788  */
8789  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8790  if (__pyx_t_4) {
8791 
8792  /* "View.MemoryView":178
8793  *
8794  * if self.dtype_is_object:
8795  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
8796  * for i in range(self.len / itemsize):
8797  * p[i] = Py_None
8798  */
8799  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8800 
8801  /* "View.MemoryView":179
8802  * if self.dtype_is_object:
8803  * p = <PyObject **> self.data
8804  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
8805  * p[i] = Py_None
8806  * Py_INCREF(Py_None)
8807  */
8808  if (unlikely(__pyx_v_itemsize == 0)) {
8809  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8810  __PYX_ERR(1, 179, __pyx_L1_error)
8811  }
8812  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
8813  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
8814  __PYX_ERR(1, 179, __pyx_L1_error)
8815  }
8816  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8817  __pyx_t_8 = __pyx_t_1;
8818  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) {
8819  __pyx_v_i = __pyx_t_11;
8820 
8821  /* "View.MemoryView":180
8822  * p = <PyObject **> self.data
8823  * for i in range(self.len / itemsize):
8824  * p[i] = Py_None # <<<<<<<<<<<<<<
8825  * Py_INCREF(Py_None)
8826  *
8827  */
8828  (__pyx_v_p[__pyx_v_i]) = Py_None;
8829 
8830  /* "View.MemoryView":181
8831  * for i in range(self.len / itemsize):
8832  * p[i] = Py_None
8833  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8834  *
8835  * @cname('getbuffer')
8836  */
8837  Py_INCREF(Py_None);
8838  }
8839 
8840  /* "View.MemoryView":177
8841  * raise MemoryError("unable to allocate array data.")
8842  *
8843  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8844  * p = <PyObject **> self.data
8845  * for i in range(self.len / itemsize):
8846  */
8847  }
8848 
8849  /* "View.MemoryView":170
8850  * self.free_data = allocate_buffer
8851  * self.dtype_is_object = format == b'O'
8852  * if allocate_buffer: # <<<<<<<<<<<<<<
8853  *
8854  *
8855  */
8856  }
8857 
8858  /* "View.MemoryView":121
8859  * cdef bint dtype_is_object
8860  *
8861  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8862  * mode="c", bint allocate_buffer=True):
8863  *
8864  */
8865 
8866  /* function exit code */
8867  __pyx_r = 0;
8868  goto __pyx_L0;
8869  __pyx_L1_error:;
8870  __Pyx_XDECREF(__pyx_t_3);
8871  __Pyx_XDECREF(__pyx_t_5);
8872  __Pyx_XDECREF(__pyx_t_9);
8873  __Pyx_XDECREF(__pyx_t_10);
8874  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8875  __pyx_r = -1;
8876  __pyx_L0:;
8877  __Pyx_XDECREF(__pyx_v_format);
8878  __Pyx_RefNannyFinishContext();
8879  return __pyx_r;
8880 }
8881 
8882 /* "View.MemoryView":184
8883  *
8884  * @cname('getbuffer')
8885  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8886  * cdef int bufmode = -1
8887  * if self.mode == u"c":
8888  */
8889 
8890 /* Python wrapper */
8891 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
8892 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8893  int __pyx_r;
8894  __Pyx_RefNannyDeclarations
8895  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
8896  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
8897 
8898  /* function exit code */
8899  __Pyx_RefNannyFinishContext();
8900  return __pyx_r;
8901 }
8902 
8903 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8904  int __pyx_v_bufmode;
8905  int __pyx_r;
8906  __Pyx_RefNannyDeclarations
8907  int __pyx_t_1;
8908  int __pyx_t_2;
8909  PyObject *__pyx_t_3 = NULL;
8910  char *__pyx_t_4;
8911  Py_ssize_t __pyx_t_5;
8912  int __pyx_t_6;
8913  Py_ssize_t *__pyx_t_7;
8914  if (__pyx_v_info == NULL) {
8915  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
8916  return -1;
8917  }
8918  __Pyx_RefNannySetupContext("__getbuffer__", 0);
8919  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8920  __Pyx_GIVEREF(__pyx_v_info->obj);
8921 
8922  /* "View.MemoryView":185
8923  * @cname('getbuffer')
8924  * def __getbuffer__(self, Py_buffer *info, int flags):
8925  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
8926  * if self.mode == u"c":
8927  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8928  */
8929  __pyx_v_bufmode = -1;
8930 
8931  /* "View.MemoryView":186
8932  * def __getbuffer__(self, Py_buffer *info, int flags):
8933  * cdef int bufmode = -1
8934  * if self.mode == u"c": # <<<<<<<<<<<<<<
8935  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8936  * elif self.mode == u"fortran":
8937  */
8938  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 186, __pyx_L1_error)
8939  __pyx_t_2 = (__pyx_t_1 != 0);
8940  if (__pyx_t_2) {
8941 
8942  /* "View.MemoryView":187
8943  * cdef int bufmode = -1
8944  * if self.mode == u"c":
8945  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8946  * elif self.mode == u"fortran":
8947  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8948  */
8949  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8950 
8951  /* "View.MemoryView":186
8952  * def __getbuffer__(self, Py_buffer *info, int flags):
8953  * cdef int bufmode = -1
8954  * if self.mode == u"c": # <<<<<<<<<<<<<<
8955  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8956  * elif self.mode == u"fortran":
8957  */
8958  goto __pyx_L3;
8959  }
8960 
8961  /* "View.MemoryView":188
8962  * if self.mode == u"c":
8963  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8964  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8965  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8966  * if not (flags & bufmode):
8967  */
8968  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
8969  __pyx_t_1 = (__pyx_t_2 != 0);
8970  if (__pyx_t_1) {
8971 
8972  /* "View.MemoryView":189
8973  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8974  * elif self.mode == u"fortran":
8975  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8976  * if not (flags & bufmode):
8977  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8978  */
8979  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8980 
8981  /* "View.MemoryView":188
8982  * if self.mode == u"c":
8983  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8984  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8985  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8986  * if not (flags & bufmode):
8987  */
8988  }
8989  __pyx_L3:;
8990 
8991  /* "View.MemoryView":190
8992  * elif self.mode == u"fortran":
8993  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8994  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8995  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8996  * info.buf = self.data
8997  */
8998  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8999  if (unlikely(__pyx_t_1)) {
9000 
9001  /* "View.MemoryView":191
9002  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9003  * if not (flags & bufmode):
9004  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
9005  * info.buf = self.data
9006  * info.len = self.len
9007  */
9008  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 191, __pyx_L1_error)
9009  __Pyx_GOTREF(__pyx_t_3);
9010  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9011  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9012  __PYX_ERR(1, 191, __pyx_L1_error)
9013 
9014  /* "View.MemoryView":190
9015  * elif self.mode == u"fortran":
9016  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9017  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9018  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9019  * info.buf = self.data
9020  */
9021  }
9022 
9023  /* "View.MemoryView":192
9024  * if not (flags & bufmode):
9025  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9026  * info.buf = self.data # <<<<<<<<<<<<<<
9027  * info.len = self.len
9028  * info.ndim = self.ndim
9029  */
9030  __pyx_t_4 = __pyx_v_self->data;
9031  __pyx_v_info->buf = __pyx_t_4;
9032 
9033  /* "View.MemoryView":193
9034  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9035  * info.buf = self.data
9036  * info.len = self.len # <<<<<<<<<<<<<<
9037  * info.ndim = self.ndim
9038  * info.shape = self._shape
9039  */
9040  __pyx_t_5 = __pyx_v_self->len;
9041  __pyx_v_info->len = __pyx_t_5;
9042 
9043  /* "View.MemoryView":194
9044  * info.buf = self.data
9045  * info.len = self.len
9046  * info.ndim = self.ndim # <<<<<<<<<<<<<<
9047  * info.shape = self._shape
9048  * info.strides = self._strides
9049  */
9050  __pyx_t_6 = __pyx_v_self->ndim;
9051  __pyx_v_info->ndim = __pyx_t_6;
9052 
9053  /* "View.MemoryView":195
9054  * info.len = self.len
9055  * info.ndim = self.ndim
9056  * info.shape = self._shape # <<<<<<<<<<<<<<
9057  * info.strides = self._strides
9058  * info.suboffsets = NULL
9059  */
9060  __pyx_t_7 = __pyx_v_self->_shape;
9061  __pyx_v_info->shape = __pyx_t_7;
9062 
9063  /* "View.MemoryView":196
9064  * info.ndim = self.ndim
9065  * info.shape = self._shape
9066  * info.strides = self._strides # <<<<<<<<<<<<<<
9067  * info.suboffsets = NULL
9068  * info.itemsize = self.itemsize
9069  */
9070  __pyx_t_7 = __pyx_v_self->_strides;
9071  __pyx_v_info->strides = __pyx_t_7;
9072 
9073  /* "View.MemoryView":197
9074  * info.shape = self._shape
9075  * info.strides = self._strides
9076  * info.suboffsets = NULL # <<<<<<<<<<<<<<
9077  * info.itemsize = self.itemsize
9078  * info.readonly = 0
9079  */
9080  __pyx_v_info->suboffsets = NULL;
9081 
9082  /* "View.MemoryView":198
9083  * info.strides = self._strides
9084  * info.suboffsets = NULL
9085  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
9086  * info.readonly = 0
9087  *
9088  */
9089  __pyx_t_5 = __pyx_v_self->itemsize;
9090  __pyx_v_info->itemsize = __pyx_t_5;
9091 
9092  /* "View.MemoryView":199
9093  * info.suboffsets = NULL
9094  * info.itemsize = self.itemsize
9095  * info.readonly = 0 # <<<<<<<<<<<<<<
9096  *
9097  * if flags & PyBUF_FORMAT:
9098  */
9099  __pyx_v_info->readonly = 0;
9100 
9101  /* "View.MemoryView":201
9102  * info.readonly = 0
9103  *
9104  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9105  * info.format = self.format
9106  * else:
9107  */
9108  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9109  if (__pyx_t_1) {
9110 
9111  /* "View.MemoryView":202
9112  *
9113  * if flags & PyBUF_FORMAT:
9114  * info.format = self.format # <<<<<<<<<<<<<<
9115  * else:
9116  * info.format = NULL
9117  */
9118  __pyx_t_4 = __pyx_v_self->format;
9119  __pyx_v_info->format = __pyx_t_4;
9120 
9121  /* "View.MemoryView":201
9122  * info.readonly = 0
9123  *
9124  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9125  * info.format = self.format
9126  * else:
9127  */
9128  goto __pyx_L5;
9129  }
9130 
9131  /* "View.MemoryView":204
9132  * info.format = self.format
9133  * else:
9134  * info.format = NULL # <<<<<<<<<<<<<<
9135  *
9136  * info.obj = self
9137  */
9138  /*else*/ {
9139  __pyx_v_info->format = NULL;
9140  }
9141  __pyx_L5:;
9142 
9143  /* "View.MemoryView":206
9144  * info.format = NULL
9145  *
9146  * info.obj = self # <<<<<<<<<<<<<<
9147  *
9148  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9149  */
9150  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9151  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9152  __Pyx_GOTREF(__pyx_v_info->obj);
9153  __Pyx_DECREF(__pyx_v_info->obj);
9154  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9155 
9156  /* "View.MemoryView":184
9157  *
9158  * @cname('getbuffer')
9159  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9160  * cdef int bufmode = -1
9161  * if self.mode == u"c":
9162  */
9163 
9164  /* function exit code */
9165  __pyx_r = 0;
9166  goto __pyx_L0;
9167  __pyx_L1_error:;
9168  __Pyx_XDECREF(__pyx_t_3);
9169  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9170  __pyx_r = -1;
9171  if (__pyx_v_info->obj != NULL) {
9172  __Pyx_GOTREF(__pyx_v_info->obj);
9173  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9174  }
9175  goto __pyx_L2;
9176  __pyx_L0:;
9177  if (__pyx_v_info->obj == Py_None) {
9178  __Pyx_GOTREF(__pyx_v_info->obj);
9179  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9180  }
9181  __pyx_L2:;
9182  __Pyx_RefNannyFinishContext();
9183  return __pyx_r;
9184 }
9185 
9186 /* "View.MemoryView":210
9187  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9188  *
9189  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9190  * if self.callback_free_data != NULL:
9191  * self.callback_free_data(self.data)
9192  */
9193 
9194 /* Python wrapper */
9195 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
9196 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9197  __Pyx_RefNannyDeclarations
9198  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9199  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
9200 
9201  /* function exit code */
9202  __Pyx_RefNannyFinishContext();
9203 }
9204 
9205 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
9206  __Pyx_RefNannyDeclarations
9207  int __pyx_t_1;
9208  __Pyx_RefNannySetupContext("__dealloc__", 0);
9209 
9210  /* "View.MemoryView":211
9211  *
9212  * def __dealloc__(array self):
9213  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9214  * self.callback_free_data(self.data)
9215  * elif self.free_data:
9216  */
9217  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9218  if (__pyx_t_1) {
9219 
9220  /* "View.MemoryView":212
9221  * def __dealloc__(array self):
9222  * if self.callback_free_data != NULL:
9223  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
9224  * elif self.free_data:
9225  * if self.dtype_is_object:
9226  */
9227  __pyx_v_self->callback_free_data(__pyx_v_self->data);
9228 
9229  /* "View.MemoryView":211
9230  *
9231  * def __dealloc__(array self):
9232  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9233  * self.callback_free_data(self.data)
9234  * elif self.free_data:
9235  */
9236  goto __pyx_L3;
9237  }
9238 
9239  /* "View.MemoryView":213
9240  * if self.callback_free_data != NULL:
9241  * self.callback_free_data(self.data)
9242  * elif self.free_data: # <<<<<<<<<<<<<<
9243  * if self.dtype_is_object:
9244  * refcount_objects_in_slice(self.data, self._shape,
9245  */
9246  __pyx_t_1 = (__pyx_v_self->free_data != 0);
9247  if (__pyx_t_1) {
9248 
9249  /* "View.MemoryView":214
9250  * self.callback_free_data(self.data)
9251  * elif self.free_data:
9252  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9253  * refcount_objects_in_slice(self.data, self._shape,
9254  * self._strides, self.ndim, False)
9255  */
9256  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9257  if (__pyx_t_1) {
9258 
9259  /* "View.MemoryView":215
9260  * elif self.free_data:
9261  * if self.dtype_is_object:
9262  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
9263  * self._strides, self.ndim, False)
9264  * free(self.data)
9265  */
9266  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9267 
9268  /* "View.MemoryView":214
9269  * self.callback_free_data(self.data)
9270  * elif self.free_data:
9271  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9272  * refcount_objects_in_slice(self.data, self._shape,
9273  * self._strides, self.ndim, False)
9274  */
9275  }
9276 
9277  /* "View.MemoryView":217
9278  * refcount_objects_in_slice(self.data, self._shape,
9279  * self._strides, self.ndim, False)
9280  * free(self.data) # <<<<<<<<<<<<<<
9281  * PyObject_Free(self._shape)
9282  *
9283  */
9284  free(__pyx_v_self->data);
9285 
9286  /* "View.MemoryView":213
9287  * if self.callback_free_data != NULL:
9288  * self.callback_free_data(self.data)
9289  * elif self.free_data: # <<<<<<<<<<<<<<
9290  * if self.dtype_is_object:
9291  * refcount_objects_in_slice(self.data, self._shape,
9292  */
9293  }
9294  __pyx_L3:;
9295 
9296  /* "View.MemoryView":218
9297  * self._strides, self.ndim, False)
9298  * free(self.data)
9299  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
9300  *
9301  * @property
9302  */
9303  PyObject_Free(__pyx_v_self->_shape);
9304 
9305  /* "View.MemoryView":210
9306  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9307  *
9308  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9309  * if self.callback_free_data != NULL:
9310  * self.callback_free_data(self.data)
9311  */
9312 
9313  /* function exit code */
9314  __Pyx_RefNannyFinishContext();
9315 }
9316 
9317 /* "View.MemoryView":221
9318  *
9319  * @property
9320  * def memview(self): # <<<<<<<<<<<<<<
9321  * return self.get_memview()
9322  *
9323  */
9324 
9325 /* Python wrapper */
9326 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
9327 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9328  PyObject *__pyx_r = 0;
9329  __Pyx_RefNannyDeclarations
9330  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9331  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
9332 
9333  /* function exit code */
9334  __Pyx_RefNannyFinishContext();
9335  return __pyx_r;
9336 }
9337 
9338 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
9339  PyObject *__pyx_r = NULL;
9340  __Pyx_RefNannyDeclarations
9341  PyObject *__pyx_t_1 = NULL;
9342  __Pyx_RefNannySetupContext("__get__", 0);
9343 
9344  /* "View.MemoryView":222
9345  * @property
9346  * def memview(self):
9347  * return self.get_memview() # <<<<<<<<<<<<<<
9348  *
9349  * @cname('get_memview')
9350  */
9351  __Pyx_XDECREF(__pyx_r);
9352  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 222, __pyx_L1_error)
9353  __Pyx_GOTREF(__pyx_t_1);
9354  __pyx_r = __pyx_t_1;
9355  __pyx_t_1 = 0;
9356  goto __pyx_L0;
9357 
9358  /* "View.MemoryView":221
9359  *
9360  * @property
9361  * def memview(self): # <<<<<<<<<<<<<<
9362  * return self.get_memview()
9363  *
9364  */
9365 
9366  /* function exit code */
9367  __pyx_L1_error:;
9368  __Pyx_XDECREF(__pyx_t_1);
9369  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9370  __pyx_r = NULL;
9371  __pyx_L0:;
9372  __Pyx_XGIVEREF(__pyx_r);
9373  __Pyx_RefNannyFinishContext();
9374  return __pyx_r;
9375 }
9376 
9377 /* "View.MemoryView":225
9378  *
9379  * @cname('get_memview')
9380  * cdef get_memview(self): # <<<<<<<<<<<<<<
9381  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9382  * return memoryview(self, flags, self.dtype_is_object)
9383  */
9384 
9385 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
9386  int __pyx_v_flags;
9387  PyObject *__pyx_r = NULL;
9388  __Pyx_RefNannyDeclarations
9389  PyObject *__pyx_t_1 = NULL;
9390  PyObject *__pyx_t_2 = NULL;
9391  PyObject *__pyx_t_3 = NULL;
9392  __Pyx_RefNannySetupContext("get_memview", 0);
9393 
9394  /* "View.MemoryView":226
9395  * @cname('get_memview')
9396  * cdef get_memview(self):
9397  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
9398  * return memoryview(self, flags, self.dtype_is_object)
9399  *
9400  */
9401  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9402 
9403  /* "View.MemoryView":227
9404  * cdef get_memview(self):
9405  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9406  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
9407  *
9408  * def __len__(self):
9409  */
9410  __Pyx_XDECREF(__pyx_r);
9411  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 227, __pyx_L1_error)
9412  __Pyx_GOTREF(__pyx_t_1);
9413  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error)
9414  __Pyx_GOTREF(__pyx_t_2);
9415  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 227, __pyx_L1_error)
9416  __Pyx_GOTREF(__pyx_t_3);
9417  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9418  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9419  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9420  __Pyx_GIVEREF(__pyx_t_1);
9421  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9422  __Pyx_GIVEREF(__pyx_t_2);
9423  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9424  __pyx_t_1 = 0;
9425  __pyx_t_2 = 0;
9426  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error)
9427  __Pyx_GOTREF(__pyx_t_2);
9428  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9429  __pyx_r = __pyx_t_2;
9430  __pyx_t_2 = 0;
9431  goto __pyx_L0;
9432 
9433  /* "View.MemoryView":225
9434  *
9435  * @cname('get_memview')
9436  * cdef get_memview(self): # <<<<<<<<<<<<<<
9437  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9438  * return memoryview(self, flags, self.dtype_is_object)
9439  */
9440 
9441  /* function exit code */
9442  __pyx_L1_error:;
9443  __Pyx_XDECREF(__pyx_t_1);
9444  __Pyx_XDECREF(__pyx_t_2);
9445  __Pyx_XDECREF(__pyx_t_3);
9446  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9447  __pyx_r = 0;
9448  __pyx_L0:;
9449  __Pyx_XGIVEREF(__pyx_r);
9450  __Pyx_RefNannyFinishContext();
9451  return __pyx_r;
9452 }
9453 
9454 /* "View.MemoryView":229
9455  * return memoryview(self, flags, self.dtype_is_object)
9456  *
9457  * def __len__(self): # <<<<<<<<<<<<<<
9458  * return self._shape[0]
9459  *
9460  */
9461 
9462 /* Python wrapper */
9463 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
9464 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9465  Py_ssize_t __pyx_r;
9466  __Pyx_RefNannyDeclarations
9467  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
9468  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
9469 
9470  /* function exit code */
9471  __Pyx_RefNannyFinishContext();
9472  return __pyx_r;
9473 }
9474 
9475 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
9476  Py_ssize_t __pyx_r;
9477  __Pyx_RefNannyDeclarations
9478  __Pyx_RefNannySetupContext("__len__", 0);
9479 
9480  /* "View.MemoryView":230
9481  *
9482  * def __len__(self):
9483  * return self._shape[0] # <<<<<<<<<<<<<<
9484  *
9485  * def __getattr__(self, attr):
9486  */
9487  __pyx_r = (__pyx_v_self->_shape[0]);
9488  goto __pyx_L0;
9489 
9490  /* "View.MemoryView":229
9491  * return memoryview(self, flags, self.dtype_is_object)
9492  *
9493  * def __len__(self): # <<<<<<<<<<<<<<
9494  * return self._shape[0]
9495  *
9496  */
9497 
9498  /* function exit code */
9499  __pyx_L0:;
9500  __Pyx_RefNannyFinishContext();
9501  return __pyx_r;
9502 }
9503 
9504 /* "View.MemoryView":232
9505  * return self._shape[0]
9506  *
9507  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9508  * return getattr(self.memview, attr)
9509  *
9510  */
9511 
9512 /* Python wrapper */
9513 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
9514 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9515  PyObject *__pyx_r = 0;
9516  __Pyx_RefNannyDeclarations
9517  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
9518  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9519 
9520  /* function exit code */
9521  __Pyx_RefNannyFinishContext();
9522  return __pyx_r;
9523 }
9524 
9525 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9526  PyObject *__pyx_r = NULL;
9527  __Pyx_RefNannyDeclarations
9528  PyObject *__pyx_t_1 = NULL;
9529  PyObject *__pyx_t_2 = NULL;
9530  __Pyx_RefNannySetupContext("__getattr__", 0);
9531 
9532  /* "View.MemoryView":233
9533  *
9534  * def __getattr__(self, attr):
9535  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
9536  *
9537  * def __getitem__(self, item):
9538  */
9539  __Pyx_XDECREF(__pyx_r);
9540  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error)
9541  __Pyx_GOTREF(__pyx_t_1);
9542  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error)
9543  __Pyx_GOTREF(__pyx_t_2);
9544  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9545  __pyx_r = __pyx_t_2;
9546  __pyx_t_2 = 0;
9547  goto __pyx_L0;
9548 
9549  /* "View.MemoryView":232
9550  * return self._shape[0]
9551  *
9552  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9553  * return getattr(self.memview, attr)
9554  *
9555  */
9556 
9557  /* function exit code */
9558  __pyx_L1_error:;
9559  __Pyx_XDECREF(__pyx_t_1);
9560  __Pyx_XDECREF(__pyx_t_2);
9561  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9562  __pyx_r = NULL;
9563  __pyx_L0:;
9564  __Pyx_XGIVEREF(__pyx_r);
9565  __Pyx_RefNannyFinishContext();
9566  return __pyx_r;
9567 }
9568 
9569 /* "View.MemoryView":235
9570  * return getattr(self.memview, attr)
9571  *
9572  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9573  * return self.memview[item]
9574  *
9575  */
9576 
9577 /* Python wrapper */
9578 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
9579 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9580  PyObject *__pyx_r = 0;
9581  __Pyx_RefNannyDeclarations
9582  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9583  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9584 
9585  /* function exit code */
9586  __Pyx_RefNannyFinishContext();
9587  return __pyx_r;
9588 }
9589 
9590 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9591  PyObject *__pyx_r = NULL;
9592  __Pyx_RefNannyDeclarations
9593  PyObject *__pyx_t_1 = NULL;
9594  PyObject *__pyx_t_2 = NULL;
9595  __Pyx_RefNannySetupContext("__getitem__", 0);
9596 
9597  /* "View.MemoryView":236
9598  *
9599  * def __getitem__(self, item):
9600  * return self.memview[item] # <<<<<<<<<<<<<<
9601  *
9602  * def __setitem__(self, item, value):
9603  */
9604  __Pyx_XDECREF(__pyx_r);
9605  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
9606  __Pyx_GOTREF(__pyx_t_1);
9607  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 236, __pyx_L1_error)
9608  __Pyx_GOTREF(__pyx_t_2);
9609  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9610  __pyx_r = __pyx_t_2;
9611  __pyx_t_2 = 0;
9612  goto __pyx_L0;
9613 
9614  /* "View.MemoryView":235
9615  * return getattr(self.memview, attr)
9616  *
9617  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9618  * return self.memview[item]
9619  *
9620  */
9621 
9622  /* function exit code */
9623  __pyx_L1_error:;
9624  __Pyx_XDECREF(__pyx_t_1);
9625  __Pyx_XDECREF(__pyx_t_2);
9626  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9627  __pyx_r = NULL;
9628  __pyx_L0:;
9629  __Pyx_XGIVEREF(__pyx_r);
9630  __Pyx_RefNannyFinishContext();
9631  return __pyx_r;
9632 }
9633 
9634 /* "View.MemoryView":238
9635  * return self.memview[item]
9636  *
9637  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9638  * self.memview[item] = value
9639  *
9640  */
9641 
9642 /* Python wrapper */
9643 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
9644 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9645  int __pyx_r;
9646  __Pyx_RefNannyDeclarations
9647  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9648  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
9649 
9650  /* function exit code */
9651  __Pyx_RefNannyFinishContext();
9652  return __pyx_r;
9653 }
9654 
9655 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9656  int __pyx_r;
9657  __Pyx_RefNannyDeclarations
9658  PyObject *__pyx_t_1 = NULL;
9659  __Pyx_RefNannySetupContext("__setitem__", 0);
9660 
9661  /* "View.MemoryView":239
9662  *
9663  * def __setitem__(self, item, value):
9664  * self.memview[item] = value # <<<<<<<<<<<<<<
9665  *
9666  *
9667  */
9668  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 239, __pyx_L1_error)
9669  __Pyx_GOTREF(__pyx_t_1);
9670  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 239, __pyx_L1_error)
9671  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9672 
9673  /* "View.MemoryView":238
9674  * return self.memview[item]
9675  *
9676  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9677  * self.memview[item] = value
9678  *
9679  */
9680 
9681  /* function exit code */
9682  __pyx_r = 0;
9683  goto __pyx_L0;
9684  __pyx_L1_error:;
9685  __Pyx_XDECREF(__pyx_t_1);
9686  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9687  __pyx_r = -1;
9688  __pyx_L0:;
9689  __Pyx_RefNannyFinishContext();
9690  return __pyx_r;
9691 }
9692 
9693 /* "(tree fragment)":1
9694  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9695  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9696  * def __setstate_cython__(self, __pyx_state):
9697  */
9698 
9699 /* Python wrapper */
9700 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9701 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
9702 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9703  PyObject *__pyx_r = 0;
9704  __Pyx_RefNannyDeclarations
9705  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9706  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
9707 
9708  /* function exit code */
9709  __Pyx_RefNannyFinishContext();
9710  return __pyx_r;
9711 }
9712 
9713 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
9714  PyObject *__pyx_r = NULL;
9715  __Pyx_RefNannyDeclarations
9716  PyObject *__pyx_t_1 = NULL;
9717  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9718 
9719  /* "(tree fragment)":2
9720  * def __reduce_cython__(self):
9721  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9722  * def __setstate_cython__(self, __pyx_state):
9723  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9724  */
9725  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9726  __Pyx_GOTREF(__pyx_t_1);
9727  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9728  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9729  __PYX_ERR(1, 2, __pyx_L1_error)
9730 
9731  /* "(tree fragment)":1
9732  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9733  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9734  * def __setstate_cython__(self, __pyx_state):
9735  */
9736 
9737  /* function exit code */
9738  __pyx_L1_error:;
9739  __Pyx_XDECREF(__pyx_t_1);
9740  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9741  __pyx_r = NULL;
9742  __Pyx_XGIVEREF(__pyx_r);
9743  __Pyx_RefNannyFinishContext();
9744  return __pyx_r;
9745 }
9746 
9747 /* "(tree fragment)":3
9748  * def __reduce_cython__(self):
9749  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9750  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9751  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9752  */
9753 
9754 /* Python wrapper */
9755 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9756 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
9757 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9758  PyObject *__pyx_r = 0;
9759  __Pyx_RefNannyDeclarations
9760  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9761  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9762 
9763  /* function exit code */
9764  __Pyx_RefNannyFinishContext();
9765  return __pyx_r;
9766 }
9767 
9768 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9769  PyObject *__pyx_r = NULL;
9770  __Pyx_RefNannyDeclarations
9771  PyObject *__pyx_t_1 = NULL;
9772  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9773 
9774  /* "(tree fragment)":4
9775  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9776  * def __setstate_cython__(self, __pyx_state):
9777  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9778  */
9779  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
9780  __Pyx_GOTREF(__pyx_t_1);
9781  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9782  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9783  __PYX_ERR(1, 4, __pyx_L1_error)
9784 
9785  /* "(tree fragment)":3
9786  * def __reduce_cython__(self):
9787  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9788  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9789  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9790  */
9791 
9792  /* function exit code */
9793  __pyx_L1_error:;
9794  __Pyx_XDECREF(__pyx_t_1);
9795  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9796  __pyx_r = NULL;
9797  __Pyx_XGIVEREF(__pyx_r);
9798  __Pyx_RefNannyFinishContext();
9799  return __pyx_r;
9800 }
9801 
9802 /* "View.MemoryView":243
9803  *
9804  * @cname("__pyx_array_new")
9805  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9806  * char *mode, char *buf):
9807  * cdef array result
9808  */
9809 
9810 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
9811  struct __pyx_array_obj *__pyx_v_result = 0;
9812  struct __pyx_array_obj *__pyx_r = NULL;
9813  __Pyx_RefNannyDeclarations
9814  int __pyx_t_1;
9815  PyObject *__pyx_t_2 = NULL;
9816  PyObject *__pyx_t_3 = NULL;
9817  PyObject *__pyx_t_4 = NULL;
9818  PyObject *__pyx_t_5 = NULL;
9819  __Pyx_RefNannySetupContext("array_cwrapper", 0);
9820 
9821  /* "View.MemoryView":247
9822  * cdef array result
9823  *
9824  * if buf == NULL: # <<<<<<<<<<<<<<
9825  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9826  * else:
9827  */
9828  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9829  if (__pyx_t_1) {
9830 
9831  /* "View.MemoryView":248
9832  *
9833  * if buf == NULL:
9834  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
9835  * else:
9836  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9837  */
9838  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 248, __pyx_L1_error)
9839  __Pyx_GOTREF(__pyx_t_2);
9840  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error)
9841  __Pyx_GOTREF(__pyx_t_3);
9842  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 248, __pyx_L1_error)
9843  __Pyx_GOTREF(__pyx_t_4);
9844  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 248, __pyx_L1_error)
9845  __Pyx_GOTREF(__pyx_t_5);
9846  __Pyx_INCREF(__pyx_v_shape);
9847  __Pyx_GIVEREF(__pyx_v_shape);
9848  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9849  __Pyx_GIVEREF(__pyx_t_2);
9850  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9851  __Pyx_GIVEREF(__pyx_t_3);
9852  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9853  __Pyx_GIVEREF(__pyx_t_4);
9854  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9855  __pyx_t_2 = 0;
9856  __pyx_t_3 = 0;
9857  __pyx_t_4 = 0;
9858  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 248, __pyx_L1_error)
9859  __Pyx_GOTREF(__pyx_t_4);
9860  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9861  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
9862  __pyx_t_4 = 0;
9863 
9864  /* "View.MemoryView":247
9865  * cdef array result
9866  *
9867  * if buf == NULL: # <<<<<<<<<<<<<<
9868  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9869  * else:
9870  */
9871  goto __pyx_L3;
9872  }
9873 
9874  /* "View.MemoryView":250
9875  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9876  * else:
9877  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9878  * allocate_buffer=False)
9879  * result.data = buf
9880  */
9881  /*else*/ {
9882  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
9883  __Pyx_GOTREF(__pyx_t_4);
9884  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
9885  __Pyx_GOTREF(__pyx_t_5);
9886  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
9887  __Pyx_GOTREF(__pyx_t_3);
9888  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
9889  __Pyx_GOTREF(__pyx_t_2);
9890  __Pyx_INCREF(__pyx_v_shape);
9891  __Pyx_GIVEREF(__pyx_v_shape);
9892  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9893  __Pyx_GIVEREF(__pyx_t_4);
9894  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9895  __Pyx_GIVEREF(__pyx_t_5);
9896  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9897  __Pyx_GIVEREF(__pyx_t_3);
9898  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9899  __pyx_t_4 = 0;
9900  __pyx_t_5 = 0;
9901  __pyx_t_3 = 0;
9902 
9903  /* "View.MemoryView":251
9904  * else:
9905  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9906  * allocate_buffer=False) # <<<<<<<<<<<<<<
9907  * result.data = buf
9908  *
9909  */
9910  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
9911  __Pyx_GOTREF(__pyx_t_3);
9912  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 251, __pyx_L1_error)
9913 
9914  /* "View.MemoryView":250
9915  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9916  * else:
9917  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9918  * allocate_buffer=False)
9919  * result.data = buf
9920  */
9921  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
9922  __Pyx_GOTREF(__pyx_t_5);
9923  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9924  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9925  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
9926  __pyx_t_5 = 0;
9927 
9928  /* "View.MemoryView":252
9929  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9930  * allocate_buffer=False)
9931  * result.data = buf # <<<<<<<<<<<<<<
9932  *
9933  * return result
9934  */
9935  __pyx_v_result->data = __pyx_v_buf;
9936  }
9937  __pyx_L3:;
9938 
9939  /* "View.MemoryView":254
9940  * result.data = buf
9941  *
9942  * return result # <<<<<<<<<<<<<<
9943  *
9944  *
9945  */
9946  __Pyx_XDECREF(((PyObject *)__pyx_r));
9947  __Pyx_INCREF(((PyObject *)__pyx_v_result));
9948  __pyx_r = __pyx_v_result;
9949  goto __pyx_L0;
9950 
9951  /* "View.MemoryView":243
9952  *
9953  * @cname("__pyx_array_new")
9954  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9955  * char *mode, char *buf):
9956  * cdef array result
9957  */
9958 
9959  /* function exit code */
9960  __pyx_L1_error:;
9961  __Pyx_XDECREF(__pyx_t_2);
9962  __Pyx_XDECREF(__pyx_t_3);
9963  __Pyx_XDECREF(__pyx_t_4);
9964  __Pyx_XDECREF(__pyx_t_5);
9965  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9966  __pyx_r = 0;
9967  __pyx_L0:;
9968  __Pyx_XDECREF((PyObject *)__pyx_v_result);
9969  __Pyx_XGIVEREF((PyObject *)__pyx_r);
9970  __Pyx_RefNannyFinishContext();
9971  return __pyx_r;
9972 }
9973 
9974 /* "View.MemoryView":280
9975  * cdef class Enum(object):
9976  * cdef object name
9977  * def __init__(self, name): # <<<<<<<<<<<<<<
9978  * self.name = name
9979  * def __repr__(self):
9980  */
9981 
9982 /* Python wrapper */
9983 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9984 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9985  PyObject *__pyx_v_name = 0;
9986  int __pyx_r;
9987  __Pyx_RefNannyDeclarations
9988  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
9989  {
9990  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9991  PyObject* values[1] = {0};
9992  if (unlikely(__pyx_kwds)) {
9993  Py_ssize_t kw_args;
9994  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9995  switch (pos_args) {
9996  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9997  CYTHON_FALLTHROUGH;
9998  case 0: break;
9999  default: goto __pyx_L5_argtuple_error;
10000  }
10001  kw_args = PyDict_Size(__pyx_kwds);
10002  switch (pos_args) {
10003  case 0:
10004  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10005  else goto __pyx_L5_argtuple_error;
10006  }
10007  if (unlikely(kw_args > 0)) {
10008  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 280, __pyx_L3_error)
10009  }
10010  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10011  goto __pyx_L5_argtuple_error;
10012  } else {
10013  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10014  }
10015  __pyx_v_name = values[0];
10016  }
10017  goto __pyx_L4_argument_unpacking_done;
10018  __pyx_L5_argtuple_error:;
10019  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 280, __pyx_L3_error)
10020  __pyx_L3_error:;
10021  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10022  __Pyx_RefNannyFinishContext();
10023  return -1;
10024  __pyx_L4_argument_unpacking_done:;
10025  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10026 
10027  /* function exit code */
10028  __Pyx_RefNannyFinishContext();
10029  return __pyx_r;
10030 }
10031 
10032 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10033  int __pyx_r;
10034  __Pyx_RefNannyDeclarations
10035  __Pyx_RefNannySetupContext("__init__", 0);
10036 
10037  /* "View.MemoryView":281
10038  * cdef object name
10039  * def __init__(self, name):
10040  * self.name = name # <<<<<<<<<<<<<<
10041  * def __repr__(self):
10042  * return self.name
10043  */
10044  __Pyx_INCREF(__pyx_v_name);
10045  __Pyx_GIVEREF(__pyx_v_name);
10046  __Pyx_GOTREF(__pyx_v_self->name);
10047  __Pyx_DECREF(__pyx_v_self->name);
10048  __pyx_v_self->name = __pyx_v_name;
10049 
10050  /* "View.MemoryView":280
10051  * cdef class Enum(object):
10052  * cdef object name
10053  * def __init__(self, name): # <<<<<<<<<<<<<<
10054  * self.name = name
10055  * def __repr__(self):
10056  */
10057 
10058  /* function exit code */
10059  __pyx_r = 0;
10060  __Pyx_RefNannyFinishContext();
10061  return __pyx_r;
10062 }
10063 
10064 /* "View.MemoryView":282
10065  * def __init__(self, name):
10066  * self.name = name
10067  * def __repr__(self): # <<<<<<<<<<<<<<
10068  * return self.name
10069  *
10070  */
10071 
10072 /* Python wrapper */
10073 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
10074 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10075  PyObject *__pyx_r = 0;
10076  __Pyx_RefNannyDeclarations
10077  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10078  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10079 
10080  /* function exit code */
10081  __Pyx_RefNannyFinishContext();
10082  return __pyx_r;
10083 }
10084 
10085 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10086  PyObject *__pyx_r = NULL;
10087  __Pyx_RefNannyDeclarations
10088  __Pyx_RefNannySetupContext("__repr__", 0);
10089 
10090  /* "View.MemoryView":283
10091  * self.name = name
10092  * def __repr__(self):
10093  * return self.name # <<<<<<<<<<<<<<
10094  *
10095  * cdef generic = Enum("<strided and direct or indirect>")
10096  */
10097  __Pyx_XDECREF(__pyx_r);
10098  __Pyx_INCREF(__pyx_v_self->name);
10099  __pyx_r = __pyx_v_self->name;
10100  goto __pyx_L0;
10101 
10102  /* "View.MemoryView":282
10103  * def __init__(self, name):
10104  * self.name = name
10105  * def __repr__(self): # <<<<<<<<<<<<<<
10106  * return self.name
10107  *
10108  */
10109 
10110  /* function exit code */
10111  __pyx_L0:;
10112  __Pyx_XGIVEREF(__pyx_r);
10113  __Pyx_RefNannyFinishContext();
10114  return __pyx_r;
10115 }
10116 
10117 /* "(tree fragment)":1
10118  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10119  * cdef bint use_setstate
10120  * state = (self.name,)
10121  */
10122 
10123 /* Python wrapper */
10124 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10125 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
10126 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10127  PyObject *__pyx_r = 0;
10128  __Pyx_RefNannyDeclarations
10129  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10130  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10131 
10132  /* function exit code */
10133  __Pyx_RefNannyFinishContext();
10134  return __pyx_r;
10135 }
10136 
10137 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10138  int __pyx_v_use_setstate;
10139  PyObject *__pyx_v_state = NULL;
10140  PyObject *__pyx_v__dict = NULL;
10141  PyObject *__pyx_r = NULL;
10142  __Pyx_RefNannyDeclarations
10143  PyObject *__pyx_t_1 = NULL;
10144  int __pyx_t_2;
10145  int __pyx_t_3;
10146  PyObject *__pyx_t_4 = NULL;
10147  PyObject *__pyx_t_5 = NULL;
10148  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10149 
10150  /* "(tree fragment)":3
10151  * def __reduce_cython__(self):
10152  * cdef bint use_setstate
10153  * state = (self.name,) # <<<<<<<<<<<<<<
10154  * _dict = getattr(self, '__dict__', None)
10155  * if _dict is not None:
10156  */
10157  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
10158  __Pyx_GOTREF(__pyx_t_1);
10159  __Pyx_INCREF(__pyx_v_self->name);
10160  __Pyx_GIVEREF(__pyx_v_self->name);
10161  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10162  __pyx_v_state = ((PyObject*)__pyx_t_1);
10163  __pyx_t_1 = 0;
10164 
10165  /* "(tree fragment)":4
10166  * cdef bint use_setstate
10167  * state = (self.name,)
10168  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
10169  * if _dict is not None:
10170  * state += (_dict,)
10171  */
10172  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10173  __Pyx_GOTREF(__pyx_t_1);
10174  __pyx_v__dict = __pyx_t_1;
10175  __pyx_t_1 = 0;
10176 
10177  /* "(tree fragment)":5
10178  * state = (self.name,)
10179  * _dict = getattr(self, '__dict__', None)
10180  * if _dict is not None: # <<<<<<<<<<<<<<
10181  * state += (_dict,)
10182  * use_setstate = True
10183  */
10184  __pyx_t_2 = (__pyx_v__dict != Py_None);
10185  __pyx_t_3 = (__pyx_t_2 != 0);
10186  if (__pyx_t_3) {
10187 
10188  /* "(tree fragment)":6
10189  * _dict = getattr(self, '__dict__', None)
10190  * if _dict is not None:
10191  * state += (_dict,) # <<<<<<<<<<<<<<
10192  * use_setstate = True
10193  * else:
10194  */
10195  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
10196  __Pyx_GOTREF(__pyx_t_1);
10197  __Pyx_INCREF(__pyx_v__dict);
10198  __Pyx_GIVEREF(__pyx_v__dict);
10199  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10200  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
10201  __Pyx_GOTREF(__pyx_t_4);
10202  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10203  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10204  __pyx_t_4 = 0;
10205 
10206  /* "(tree fragment)":7
10207  * if _dict is not None:
10208  * state += (_dict,)
10209  * use_setstate = True # <<<<<<<<<<<<<<
10210  * else:
10211  * use_setstate = self.name is not None
10212  */
10213  __pyx_v_use_setstate = 1;
10214 
10215  /* "(tree fragment)":5
10216  * state = (self.name,)
10217  * _dict = getattr(self, '__dict__', None)
10218  * if _dict is not None: # <<<<<<<<<<<<<<
10219  * state += (_dict,)
10220  * use_setstate = True
10221  */
10222  goto __pyx_L3;
10223  }
10224 
10225  /* "(tree fragment)":9
10226  * use_setstate = True
10227  * else:
10228  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
10229  * if use_setstate:
10230  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10231  */
10232  /*else*/ {
10233  __pyx_t_3 = (__pyx_v_self->name != Py_None);
10234  __pyx_v_use_setstate = __pyx_t_3;
10235  }
10236  __pyx_L3:;
10237 
10238  /* "(tree fragment)":10
10239  * else:
10240  * use_setstate = self.name is not None
10241  * if use_setstate: # <<<<<<<<<<<<<<
10242  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10243  * else:
10244  */
10245  __pyx_t_3 = (__pyx_v_use_setstate != 0);
10246  if (__pyx_t_3) {
10247 
10248  /* "(tree fragment)":11
10249  * use_setstate = self.name is not None
10250  * if use_setstate:
10251  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
10252  * else:
10253  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10254  */
10255  __Pyx_XDECREF(__pyx_r);
10256  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error)
10257  __Pyx_GOTREF(__pyx_t_4);
10258  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error)
10259  __Pyx_GOTREF(__pyx_t_1);
10260  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10261  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10262  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10263  __Pyx_INCREF(__pyx_int_184977713);
10264  __Pyx_GIVEREF(__pyx_int_184977713);
10265  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10266  __Pyx_INCREF(Py_None);
10267  __Pyx_GIVEREF(Py_None);
10268  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10269  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 11, __pyx_L1_error)
10270  __Pyx_GOTREF(__pyx_t_5);
10271  __Pyx_GIVEREF(__pyx_t_4);
10272  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10273  __Pyx_GIVEREF(__pyx_t_1);
10274  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10275  __Pyx_INCREF(__pyx_v_state);
10276  __Pyx_GIVEREF(__pyx_v_state);
10277  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10278  __pyx_t_4 = 0;
10279  __pyx_t_1 = 0;
10280  __pyx_r = __pyx_t_5;
10281  __pyx_t_5 = 0;
10282  goto __pyx_L0;
10283 
10284  /* "(tree fragment)":10
10285  * else:
10286  * use_setstate = self.name is not None
10287  * if use_setstate: # <<<<<<<<<<<<<<
10288  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10289  * else:
10290  */
10291  }
10292 
10293  /* "(tree fragment)":13
10294  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10295  * else:
10296  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
10297  * def __setstate_cython__(self, __pyx_state):
10298  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10299  */
10300  /*else*/ {
10301  __Pyx_XDECREF(__pyx_r);
10302  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
10303  __Pyx_GOTREF(__pyx_t_5);
10304  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
10305  __Pyx_GOTREF(__pyx_t_1);
10306  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10307  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10308  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10309  __Pyx_INCREF(__pyx_int_184977713);
10310  __Pyx_GIVEREF(__pyx_int_184977713);
10311  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10312  __Pyx_INCREF(__pyx_v_state);
10313  __Pyx_GIVEREF(__pyx_v_state);
10314  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10315  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
10316  __Pyx_GOTREF(__pyx_t_4);
10317  __Pyx_GIVEREF(__pyx_t_5);
10318  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10319  __Pyx_GIVEREF(__pyx_t_1);
10320  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10321  __pyx_t_5 = 0;
10322  __pyx_t_1 = 0;
10323  __pyx_r = __pyx_t_4;
10324  __pyx_t_4 = 0;
10325  goto __pyx_L0;
10326  }
10327 
10328  /* "(tree fragment)":1
10329  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10330  * cdef bint use_setstate
10331  * state = (self.name,)
10332  */
10333 
10334  /* function exit code */
10335  __pyx_L1_error:;
10336  __Pyx_XDECREF(__pyx_t_1);
10337  __Pyx_XDECREF(__pyx_t_4);
10338  __Pyx_XDECREF(__pyx_t_5);
10339  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10340  __pyx_r = NULL;
10341  __pyx_L0:;
10342  __Pyx_XDECREF(__pyx_v_state);
10343  __Pyx_XDECREF(__pyx_v__dict);
10344  __Pyx_XGIVEREF(__pyx_r);
10345  __Pyx_RefNannyFinishContext();
10346  return __pyx_r;
10347 }
10348 
10349 /* "(tree fragment)":14
10350  * else:
10351  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10352  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10353  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10354  */
10355 
10356 /* Python wrapper */
10357 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10358 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
10359 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10360  PyObject *__pyx_r = 0;
10361  __Pyx_RefNannyDeclarations
10362  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10363  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10364 
10365  /* function exit code */
10366  __Pyx_RefNannyFinishContext();
10367  return __pyx_r;
10368 }
10369 
10370 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10371  PyObject *__pyx_r = NULL;
10372  __Pyx_RefNannyDeclarations
10373  PyObject *__pyx_t_1 = NULL;
10374  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10375 
10376  /* "(tree fragment)":15
10377  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10378  * def __setstate_cython__(self, __pyx_state):
10379  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
10380  */
10381  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error)
10382  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
10383  __Pyx_GOTREF(__pyx_t_1);
10384  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10385 
10386  /* "(tree fragment)":14
10387  * else:
10388  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10389  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10390  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10391  */
10392 
10393  /* function exit code */
10394  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10395  goto __pyx_L0;
10396  __pyx_L1_error:;
10397  __Pyx_XDECREF(__pyx_t_1);
10398  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10399  __pyx_r = NULL;
10400  __pyx_L0:;
10401  __Pyx_XGIVEREF(__pyx_r);
10402  __Pyx_RefNannyFinishContext();
10403  return __pyx_r;
10404 }
10405 
10406 /* "View.MemoryView":297
10407  *
10408  * @cname('__pyx_align_pointer')
10409  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10410  * "Align pointer memory on a given boundary"
10411  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10412  */
10413 
10414 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
10415  Py_intptr_t __pyx_v_aligned_p;
10416  size_t __pyx_v_offset;
10417  void *__pyx_r;
10418  int __pyx_t_1;
10419 
10420  /* "View.MemoryView":299
10421  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
10422  * "Align pointer memory on a given boundary"
10423  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
10424  * cdef size_t offset
10425  *
10426  */
10427  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10428 
10429  /* "View.MemoryView":303
10430  *
10431  * with cython.cdivision(True):
10432  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
10433  *
10434  * if offset > 0:
10435  */
10436  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10437 
10438  /* "View.MemoryView":305
10439  * offset = aligned_p % alignment
10440  *
10441  * if offset > 0: # <<<<<<<<<<<<<<
10442  * aligned_p += alignment - offset
10443  *
10444  */
10445  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10446  if (__pyx_t_1) {
10447 
10448  /* "View.MemoryView":306
10449  *
10450  * if offset > 0:
10451  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
10452  *
10453  * return <void *> aligned_p
10454  */
10455  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10456 
10457  /* "View.MemoryView":305
10458  * offset = aligned_p % alignment
10459  *
10460  * if offset > 0: # <<<<<<<<<<<<<<
10461  * aligned_p += alignment - offset
10462  *
10463  */
10464  }
10465 
10466  /* "View.MemoryView":308
10467  * aligned_p += alignment - offset
10468  *
10469  * return <void *> aligned_p # <<<<<<<<<<<<<<
10470  *
10471  *
10472  */
10473  __pyx_r = ((void *)__pyx_v_aligned_p);
10474  goto __pyx_L0;
10475 
10476  /* "View.MemoryView":297
10477  *
10478  * @cname('__pyx_align_pointer')
10479  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10480  * "Align pointer memory on a given boundary"
10481  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10482  */
10483 
10484  /* function exit code */
10485  __pyx_L0:;
10486  return __pyx_r;
10487 }
10488 
10489 /* "View.MemoryView":344
10490  * cdef __Pyx_TypeInfo *typeinfo
10491  *
10492  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10493  * self.obj = obj
10494  * self.flags = flags
10495  */
10496 
10497 /* Python wrapper */
10498 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10499 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10500  PyObject *__pyx_v_obj = 0;
10501  int __pyx_v_flags;
10502  int __pyx_v_dtype_is_object;
10503  int __pyx_r;
10504  __Pyx_RefNannyDeclarations
10505  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10506  {
10507  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10508  PyObject* values[3] = {0,0,0};
10509  if (unlikely(__pyx_kwds)) {
10510  Py_ssize_t kw_args;
10511  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10512  switch (pos_args) {
10513  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10514  CYTHON_FALLTHROUGH;
10515  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10516  CYTHON_FALLTHROUGH;
10517  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10518  CYTHON_FALLTHROUGH;
10519  case 0: break;
10520  default: goto __pyx_L5_argtuple_error;
10521  }
10522  kw_args = PyDict_Size(__pyx_kwds);
10523  switch (pos_args) {
10524  case 0:
10525  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10526  else goto __pyx_L5_argtuple_error;
10527  CYTHON_FALLTHROUGH;
10528  case 1:
10529  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10530  else {
10531  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 344, __pyx_L3_error)
10532  }
10533  CYTHON_FALLTHROUGH;
10534  case 2:
10535  if (kw_args > 0) {
10536  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10537  if (value) { values[2] = value; kw_args--; }
10538  }
10539  }
10540  if (unlikely(kw_args > 0)) {
10541  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 344, __pyx_L3_error)
10542  }
10543  } else {
10544  switch (PyTuple_GET_SIZE(__pyx_args)) {
10545  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10546  CYTHON_FALLTHROUGH;
10547  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10548  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10549  break;
10550  default: goto __pyx_L5_argtuple_error;
10551  }
10552  }
10553  __pyx_v_obj = values[0];
10554  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L3_error)
10555  if (values[2]) {
10556  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L3_error)
10557  } else {
10558  __pyx_v_dtype_is_object = ((int)0);
10559  }
10560  }
10561  goto __pyx_L4_argument_unpacking_done;
10562  __pyx_L5_argtuple_error:;
10563  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 344, __pyx_L3_error)
10564  __pyx_L3_error:;
10565  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10566  __Pyx_RefNannyFinishContext();
10567  return -1;
10568  __pyx_L4_argument_unpacking_done:;
10569  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
10570 
10571  /* function exit code */
10572  __Pyx_RefNannyFinishContext();
10573  return __pyx_r;
10574 }
10575 
10576 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
10577  int __pyx_r;
10578  __Pyx_RefNannyDeclarations
10579  int __pyx_t_1;
10580  int __pyx_t_2;
10581  int __pyx_t_3;
10582  int __pyx_t_4;
10583  __Pyx_RefNannySetupContext("__cinit__", 0);
10584 
10585  /* "View.MemoryView":345
10586  *
10587  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10588  * self.obj = obj # <<<<<<<<<<<<<<
10589  * self.flags = flags
10590  * if type(self) is memoryview or obj is not None:
10591  */
10592  __Pyx_INCREF(__pyx_v_obj);
10593  __Pyx_GIVEREF(__pyx_v_obj);
10594  __Pyx_GOTREF(__pyx_v_self->obj);
10595  __Pyx_DECREF(__pyx_v_self->obj);
10596  __pyx_v_self->obj = __pyx_v_obj;
10597 
10598  /* "View.MemoryView":346
10599  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10600  * self.obj = obj
10601  * self.flags = flags # <<<<<<<<<<<<<<
10602  * if type(self) is memoryview or obj is not None:
10603  * __Pyx_GetBuffer(obj, &self.view, flags)
10604  */
10605  __pyx_v_self->flags = __pyx_v_flags;
10606 
10607  /* "View.MemoryView":347
10608  * self.obj = obj
10609  * self.flags = flags
10610  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10611  * __Pyx_GetBuffer(obj, &self.view, flags)
10612  * if <PyObject *> self.view.obj == NULL:
10613  */
10614  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10615  __pyx_t_3 = (__pyx_t_2 != 0);
10616  if (!__pyx_t_3) {
10617  } else {
10618  __pyx_t_1 = __pyx_t_3;
10619  goto __pyx_L4_bool_binop_done;
10620  }
10621  __pyx_t_3 = (__pyx_v_obj != Py_None);
10622  __pyx_t_2 = (__pyx_t_3 != 0);
10623  __pyx_t_1 = __pyx_t_2;
10624  __pyx_L4_bool_binop_done:;
10625  if (__pyx_t_1) {
10626 
10627  /* "View.MemoryView":348
10628  * self.flags = flags
10629  * if type(self) is memoryview or obj is not None:
10630  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
10631  * if <PyObject *> self.view.obj == NULL:
10632  * (<__pyx_buffer *> &self.view).obj = Py_None
10633  */
10634  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 348, __pyx_L1_error)
10635 
10636  /* "View.MemoryView":349
10637  * if type(self) is memoryview or obj is not None:
10638  * __Pyx_GetBuffer(obj, &self.view, flags)
10639  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10640  * (<__pyx_buffer *> &self.view).obj = Py_None
10641  * Py_INCREF(Py_None)
10642  */
10643  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10644  if (__pyx_t_1) {
10645 
10646  /* "View.MemoryView":350
10647  * __Pyx_GetBuffer(obj, &self.view, flags)
10648  * if <PyObject *> self.view.obj == NULL:
10649  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
10650  * Py_INCREF(Py_None)
10651  *
10652  */
10653  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10654 
10655  /* "View.MemoryView":351
10656  * if <PyObject *> self.view.obj == NULL:
10657  * (<__pyx_buffer *> &self.view).obj = Py_None
10658  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
10659  *
10660  * global __pyx_memoryview_thread_locks_used
10661  */
10662  Py_INCREF(Py_None);
10663 
10664  /* "View.MemoryView":349
10665  * if type(self) is memoryview or obj is not None:
10666  * __Pyx_GetBuffer(obj, &self.view, flags)
10667  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10668  * (<__pyx_buffer *> &self.view).obj = Py_None
10669  * Py_INCREF(Py_None)
10670  */
10671  }
10672 
10673  /* "View.MemoryView":347
10674  * self.obj = obj
10675  * self.flags = flags
10676  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10677  * __Pyx_GetBuffer(obj, &self.view, flags)
10678  * if <PyObject *> self.view.obj == NULL:
10679  */
10680  }
10681 
10682  /* "View.MemoryView":354
10683  *
10684  * global __pyx_memoryview_thread_locks_used
10685  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10686  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10687  * __pyx_memoryview_thread_locks_used += 1
10688  */
10689  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10690  if (__pyx_t_1) {
10691 
10692  /* "View.MemoryView":355
10693  * global __pyx_memoryview_thread_locks_used
10694  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10695  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
10696  * __pyx_memoryview_thread_locks_used += 1
10697  * if self.lock is NULL:
10698  */
10699  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10700 
10701  /* "View.MemoryView":356
10702  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10703  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10704  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
10705  * if self.lock is NULL:
10706  * self.lock = PyThread_allocate_lock()
10707  */
10708  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10709 
10710  /* "View.MemoryView":354
10711  *
10712  * global __pyx_memoryview_thread_locks_used
10713  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10714  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10715  * __pyx_memoryview_thread_locks_used += 1
10716  */
10717  }
10718 
10719  /* "View.MemoryView":357
10720  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10721  * __pyx_memoryview_thread_locks_used += 1
10722  * if self.lock is NULL: # <<<<<<<<<<<<<<
10723  * self.lock = PyThread_allocate_lock()
10724  * if self.lock is NULL:
10725  */
10726  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10727  if (__pyx_t_1) {
10728 
10729  /* "View.MemoryView":358
10730  * __pyx_memoryview_thread_locks_used += 1
10731  * if self.lock is NULL:
10732  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
10733  * if self.lock is NULL:
10734  * raise MemoryError
10735  */
10736  __pyx_v_self->lock = PyThread_allocate_lock();
10737 
10738  /* "View.MemoryView":359
10739  * if self.lock is NULL:
10740  * self.lock = PyThread_allocate_lock()
10741  * if self.lock is NULL: # <<<<<<<<<<<<<<
10742  * raise MemoryError
10743  *
10744  */
10745  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10746  if (unlikely(__pyx_t_1)) {
10747 
10748  /* "View.MemoryView":360
10749  * self.lock = PyThread_allocate_lock()
10750  * if self.lock is NULL:
10751  * raise MemoryError # <<<<<<<<<<<<<<
10752  *
10753  * if flags & PyBUF_FORMAT:
10754  */
10755  PyErr_NoMemory(); __PYX_ERR(1, 360, __pyx_L1_error)
10756 
10757  /* "View.MemoryView":359
10758  * if self.lock is NULL:
10759  * self.lock = PyThread_allocate_lock()
10760  * if self.lock is NULL: # <<<<<<<<<<<<<<
10761  * raise MemoryError
10762  *
10763  */
10764  }
10765 
10766  /* "View.MemoryView":357
10767  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10768  * __pyx_memoryview_thread_locks_used += 1
10769  * if self.lock is NULL: # <<<<<<<<<<<<<<
10770  * self.lock = PyThread_allocate_lock()
10771  * if self.lock is NULL:
10772  */
10773  }
10774 
10775  /* "View.MemoryView":362
10776  * raise MemoryError
10777  *
10778  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10779  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10780  * else:
10781  */
10782  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10783  if (__pyx_t_1) {
10784 
10785  /* "View.MemoryView":363
10786  *
10787  * if flags & PyBUF_FORMAT:
10788  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
10789  * else:
10790  * self.dtype_is_object = dtype_is_object
10791  */
10792  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
10793  if (__pyx_t_2) {
10794  } else {
10795  __pyx_t_1 = __pyx_t_2;
10796  goto __pyx_L11_bool_binop_done;
10797  }
10798  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
10799  __pyx_t_1 = __pyx_t_2;
10800  __pyx_L11_bool_binop_done:;
10801  __pyx_v_self->dtype_is_object = __pyx_t_1;
10802 
10803  /* "View.MemoryView":362
10804  * raise MemoryError
10805  *
10806  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10807  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10808  * else:
10809  */
10810  goto __pyx_L10;
10811  }
10812 
10813  /* "View.MemoryView":365
10814  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10815  * else:
10816  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
10817  *
10818  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10819  */
10820  /*else*/ {
10821  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10822  }
10823  __pyx_L10:;
10824 
10825  /* "View.MemoryView":367
10826  * self.dtype_is_object = dtype_is_object
10827  *
10828  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
10829  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10830  * self.typeinfo = NULL
10831  */
10832  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
10833 
10834  /* "View.MemoryView":369
10835  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10836  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10837  * self.typeinfo = NULL # <<<<<<<<<<<<<<
10838  *
10839  * def __dealloc__(memoryview self):
10840  */
10841  __pyx_v_self->typeinfo = NULL;
10842 
10843  /* "View.MemoryView":344
10844  * cdef __Pyx_TypeInfo *typeinfo
10845  *
10846  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10847  * self.obj = obj
10848  * self.flags = flags
10849  */
10850 
10851  /* function exit code */
10852  __pyx_r = 0;
10853  goto __pyx_L0;
10854  __pyx_L1_error:;
10855  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10856  __pyx_r = -1;
10857  __pyx_L0:;
10858  __Pyx_RefNannyFinishContext();
10859  return __pyx_r;
10860 }
10861 
10862 /* "View.MemoryView":371
10863  * self.typeinfo = NULL
10864  *
10865  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10866  * if self.obj is not None:
10867  * __Pyx_ReleaseBuffer(&self.view)
10868  */
10869 
10870 /* Python wrapper */
10871 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
10872 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10873  __Pyx_RefNannyDeclarations
10874  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10875  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10876 
10877  /* function exit code */
10878  __Pyx_RefNannyFinishContext();
10879 }
10880 
10881 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
10882  int __pyx_v_i;
10883  __Pyx_RefNannyDeclarations
10884  int __pyx_t_1;
10885  int __pyx_t_2;
10886  int __pyx_t_3;
10887  int __pyx_t_4;
10888  int __pyx_t_5;
10889  PyThread_type_lock __pyx_t_6;
10890  PyThread_type_lock __pyx_t_7;
10891  __Pyx_RefNannySetupContext("__dealloc__", 0);
10892 
10893  /* "View.MemoryView":372
10894  *
10895  * def __dealloc__(memoryview self):
10896  * if self.obj is not None: # <<<<<<<<<<<<<<
10897  * __Pyx_ReleaseBuffer(&self.view)
10898  *
10899  */
10900  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10901  __pyx_t_2 = (__pyx_t_1 != 0);
10902  if (__pyx_t_2) {
10903 
10904  /* "View.MemoryView":373
10905  * def __dealloc__(memoryview self):
10906  * if self.obj is not None:
10907  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
10908  *
10909  * cdef int i
10910  */
10911  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10912 
10913  /* "View.MemoryView":372
10914  *
10915  * def __dealloc__(memoryview self):
10916  * if self.obj is not None: # <<<<<<<<<<<<<<
10917  * __Pyx_ReleaseBuffer(&self.view)
10918  *
10919  */
10920  }
10921 
10922  /* "View.MemoryView":377
10923  * cdef int i
10924  * global __pyx_memoryview_thread_locks_used
10925  * if self.lock != NULL: # <<<<<<<<<<<<<<
10926  * for i in range(__pyx_memoryview_thread_locks_used):
10927  * if __pyx_memoryview_thread_locks[i] is self.lock:
10928  */
10929  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10930  if (__pyx_t_2) {
10931 
10932  /* "View.MemoryView":378
10933  * global __pyx_memoryview_thread_locks_used
10934  * if self.lock != NULL:
10935  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
10936  * if __pyx_memoryview_thread_locks[i] is self.lock:
10937  * __pyx_memoryview_thread_locks_used -= 1
10938  */
10939  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10940  __pyx_t_4 = __pyx_t_3;
10941  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10942  __pyx_v_i = __pyx_t_5;
10943 
10944  /* "View.MemoryView":379
10945  * if self.lock != NULL:
10946  * for i in range(__pyx_memoryview_thread_locks_used):
10947  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10948  * __pyx_memoryview_thread_locks_used -= 1
10949  * if i != __pyx_memoryview_thread_locks_used:
10950  */
10951  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10952  if (__pyx_t_2) {
10953 
10954  /* "View.MemoryView":380
10955  * for i in range(__pyx_memoryview_thread_locks_used):
10956  * if __pyx_memoryview_thread_locks[i] is self.lock:
10957  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
10958  * if i != __pyx_memoryview_thread_locks_used:
10959  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10960  */
10961  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10962 
10963  /* "View.MemoryView":381
10964  * if __pyx_memoryview_thread_locks[i] is self.lock:
10965  * __pyx_memoryview_thread_locks_used -= 1
10966  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10967  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10968  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10969  */
10970  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10971  if (__pyx_t_2) {
10972 
10973  /* "View.MemoryView":383
10974  * if i != __pyx_memoryview_thread_locks_used:
10975  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10976  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
10977  * break
10978  * else:
10979  */
10980  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10981  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10982 
10983  /* "View.MemoryView":382
10984  * __pyx_memoryview_thread_locks_used -= 1
10985  * if i != __pyx_memoryview_thread_locks_used:
10986  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
10987  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10988  * break
10989  */
10990  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10991  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10992 
10993  /* "View.MemoryView":381
10994  * if __pyx_memoryview_thread_locks[i] is self.lock:
10995  * __pyx_memoryview_thread_locks_used -= 1
10996  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10997  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10998  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10999  */
11000  }
11001 
11002  /* "View.MemoryView":384
11003  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11004  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11005  * break # <<<<<<<<<<<<<<
11006  * else:
11007  * PyThread_free_lock(self.lock)
11008  */
11009  goto __pyx_L6_break;
11010 
11011  /* "View.MemoryView":379
11012  * if self.lock != NULL:
11013  * for i in range(__pyx_memoryview_thread_locks_used):
11014  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11015  * __pyx_memoryview_thread_locks_used -= 1
11016  * if i != __pyx_memoryview_thread_locks_used:
11017  */
11018  }
11019  }
11020  /*else*/ {
11021 
11022  /* "View.MemoryView":386
11023  * break
11024  * else:
11025  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
11026  *
11027  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11028  */
11029  PyThread_free_lock(__pyx_v_self->lock);
11030  }
11031  __pyx_L6_break:;
11032 
11033  /* "View.MemoryView":377
11034  * cdef int i
11035  * global __pyx_memoryview_thread_locks_used
11036  * if self.lock != NULL: # <<<<<<<<<<<<<<
11037  * for i in range(__pyx_memoryview_thread_locks_used):
11038  * if __pyx_memoryview_thread_locks[i] is self.lock:
11039  */
11040  }
11041 
11042  /* "View.MemoryView":371
11043  * self.typeinfo = NULL
11044  *
11045  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11046  * if self.obj is not None:
11047  * __Pyx_ReleaseBuffer(&self.view)
11048  */
11049 
11050  /* function exit code */
11051  __Pyx_RefNannyFinishContext();
11052 }
11053 
11054 /* "View.MemoryView":388
11055  * PyThread_free_lock(self.lock)
11056  *
11057  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11058  * cdef Py_ssize_t dim
11059  * cdef char *itemp = <char *> self.view.buf
11060  */
11061 
11062 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11063  Py_ssize_t __pyx_v_dim;
11064  char *__pyx_v_itemp;
11065  PyObject *__pyx_v_idx = NULL;
11066  char *__pyx_r;
11067  __Pyx_RefNannyDeclarations
11068  Py_ssize_t __pyx_t_1;
11069  PyObject *__pyx_t_2 = NULL;
11070  Py_ssize_t __pyx_t_3;
11071  PyObject *(*__pyx_t_4)(PyObject *);
11072  PyObject *__pyx_t_5 = NULL;
11073  Py_ssize_t __pyx_t_6;
11074  char *__pyx_t_7;
11075  __Pyx_RefNannySetupContext("get_item_pointer", 0);
11076 
11077  /* "View.MemoryView":390
11078  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11079  * cdef Py_ssize_t dim
11080  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
11081  *
11082  * for dim, idx in enumerate(index):
11083  */
11084  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
11085 
11086  /* "View.MemoryView":392
11087  * cdef char *itemp = <char *> self.view.buf
11088  *
11089  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11090  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11091  *
11092  */
11093  __pyx_t_1 = 0;
11094  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11095  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11096  __pyx_t_4 = NULL;
11097  } else {
11098  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 392, __pyx_L1_error)
11099  __Pyx_GOTREF(__pyx_t_2);
11100  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 392, __pyx_L1_error)
11101  }
11102  for (;;) {
11103  if (likely(!__pyx_t_4)) {
11104  if (likely(PyList_CheckExact(__pyx_t_2))) {
11105  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
11106  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11107  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error)
11108  #else
11109  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error)
11110  __Pyx_GOTREF(__pyx_t_5);
11111  #endif
11112  } else {
11113  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11114  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11115  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error)
11116  #else
11117  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error)
11118  __Pyx_GOTREF(__pyx_t_5);
11119  #endif
11120  }
11121  } else {
11122  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11123  if (unlikely(!__pyx_t_5)) {
11124  PyObject* exc_type = PyErr_Occurred();
11125  if (exc_type) {
11126  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11127  else __PYX_ERR(1, 392, __pyx_L1_error)
11128  }
11129  break;
11130  }
11131  __Pyx_GOTREF(__pyx_t_5);
11132  }
11133  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11134  __pyx_t_5 = 0;
11135  __pyx_v_dim = __pyx_t_1;
11136  __pyx_t_1 = (__pyx_t_1 + 1);
11137 
11138  /* "View.MemoryView":393
11139  *
11140  * for dim, idx in enumerate(index):
11141  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
11142  *
11143  * return itemp
11144  */
11145  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 393, __pyx_L1_error)
11146  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 393, __pyx_L1_error)
11147  __pyx_v_itemp = __pyx_t_7;
11148 
11149  /* "View.MemoryView":392
11150  * cdef char *itemp = <char *> self.view.buf
11151  *
11152  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11153  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11154  *
11155  */
11156  }
11157  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11158 
11159  /* "View.MemoryView":395
11160  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11161  *
11162  * return itemp # <<<<<<<<<<<<<<
11163  *
11164  *
11165  */
11166  __pyx_r = __pyx_v_itemp;
11167  goto __pyx_L0;
11168 
11169  /* "View.MemoryView":388
11170  * PyThread_free_lock(self.lock)
11171  *
11172  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11173  * cdef Py_ssize_t dim
11174  * cdef char *itemp = <char *> self.view.buf
11175  */
11176 
11177  /* function exit code */
11178  __pyx_L1_error:;
11179  __Pyx_XDECREF(__pyx_t_2);
11180  __Pyx_XDECREF(__pyx_t_5);
11181  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11182  __pyx_r = NULL;
11183  __pyx_L0:;
11184  __Pyx_XDECREF(__pyx_v_idx);
11185  __Pyx_RefNannyFinishContext();
11186  return __pyx_r;
11187 }
11188 
11189 /* "View.MemoryView":398
11190  *
11191  *
11192  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11193  * if index is Ellipsis:
11194  * return self
11195  */
11196 
11197 /* Python wrapper */
11198 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
11199 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11200  PyObject *__pyx_r = 0;
11201  __Pyx_RefNannyDeclarations
11202  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
11203  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11204 
11205  /* function exit code */
11206  __Pyx_RefNannyFinishContext();
11207  return __pyx_r;
11208 }
11209 
11210 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11211  PyObject *__pyx_v_have_slices = NULL;
11212  PyObject *__pyx_v_indices = NULL;
11213  char *__pyx_v_itemp;
11214  PyObject *__pyx_r = NULL;
11215  __Pyx_RefNannyDeclarations
11216  int __pyx_t_1;
11217  int __pyx_t_2;
11218  PyObject *__pyx_t_3 = NULL;
11219  PyObject *__pyx_t_4 = NULL;
11220  PyObject *__pyx_t_5 = NULL;
11221  char *__pyx_t_6;
11222  __Pyx_RefNannySetupContext("__getitem__", 0);
11223 
11224  /* "View.MemoryView":399
11225  *
11226  * def __getitem__(memoryview self, object index):
11227  * if index is Ellipsis: # <<<<<<<<<<<<<<
11228  * return self
11229  *
11230  */
11231  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11232  __pyx_t_2 = (__pyx_t_1 != 0);
11233  if (__pyx_t_2) {
11234 
11235  /* "View.MemoryView":400
11236  * def __getitem__(memoryview self, object index):
11237  * if index is Ellipsis:
11238  * return self # <<<<<<<<<<<<<<
11239  *
11240  * have_slices, indices = _unellipsify(index, self.view.ndim)
11241  */
11242  __Pyx_XDECREF(__pyx_r);
11243  __Pyx_INCREF(((PyObject *)__pyx_v_self));
11244  __pyx_r = ((PyObject *)__pyx_v_self);
11245  goto __pyx_L0;
11246 
11247  /* "View.MemoryView":399
11248  *
11249  * def __getitem__(memoryview self, object index):
11250  * if index is Ellipsis: # <<<<<<<<<<<<<<
11251  * return self
11252  *
11253  */
11254  }
11255 
11256  /* "View.MemoryView":402
11257  * return self
11258  *
11259  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11260  *
11261  * cdef char *itemp
11262  */
11263  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 402, __pyx_L1_error)
11264  __Pyx_GOTREF(__pyx_t_3);
11265  if (likely(__pyx_t_3 != Py_None)) {
11266  PyObject* sequence = __pyx_t_3;
11267  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11268  if (unlikely(size != 2)) {
11269  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11270  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11271  __PYX_ERR(1, 402, __pyx_L1_error)
11272  }
11273  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11274  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11275  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11276  __Pyx_INCREF(__pyx_t_4);
11277  __Pyx_INCREF(__pyx_t_5);
11278  #else
11279  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 402, __pyx_L1_error)
11280  __Pyx_GOTREF(__pyx_t_4);
11281  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 402, __pyx_L1_error)
11282  __Pyx_GOTREF(__pyx_t_5);
11283  #endif
11284  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11285  } else {
11286  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 402, __pyx_L1_error)
11287  }
11288  __pyx_v_have_slices = __pyx_t_4;
11289  __pyx_t_4 = 0;
11290  __pyx_v_indices = __pyx_t_5;
11291  __pyx_t_5 = 0;
11292 
11293  /* "View.MemoryView":405
11294  *
11295  * cdef char *itemp
11296  * if have_slices: # <<<<<<<<<<<<<<
11297  * return memview_slice(self, indices)
11298  * else:
11299  */
11300  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 405, __pyx_L1_error)
11301  if (__pyx_t_2) {
11302 
11303  /* "View.MemoryView":406
11304  * cdef char *itemp
11305  * if have_slices:
11306  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
11307  * else:
11308  * itemp = self.get_item_pointer(indices)
11309  */
11310  __Pyx_XDECREF(__pyx_r);
11311  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error)
11312  __Pyx_GOTREF(__pyx_t_3);
11313  __pyx_r = __pyx_t_3;
11314  __pyx_t_3 = 0;
11315  goto __pyx_L0;
11316 
11317  /* "View.MemoryView":405
11318  *
11319  * cdef char *itemp
11320  * if have_slices: # <<<<<<<<<<<<<<
11321  * return memview_slice(self, indices)
11322  * else:
11323  */
11324  }
11325 
11326  /* "View.MemoryView":408
11327  * return memview_slice(self, indices)
11328  * else:
11329  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
11330  * return self.convert_item_to_object(itemp)
11331  *
11332  */
11333  /*else*/ {
11334  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 408, __pyx_L1_error)
11335  __pyx_v_itemp = __pyx_t_6;
11336 
11337  /* "View.MemoryView":409
11338  * else:
11339  * itemp = self.get_item_pointer(indices)
11340  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
11341  *
11342  * def __setitem__(memoryview self, object index, object value):
11343  */
11344  __Pyx_XDECREF(__pyx_r);
11345  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
11346  __Pyx_GOTREF(__pyx_t_3);
11347  __pyx_r = __pyx_t_3;
11348  __pyx_t_3 = 0;
11349  goto __pyx_L0;
11350  }
11351 
11352  /* "View.MemoryView":398
11353  *
11354  *
11355  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11356  * if index is Ellipsis:
11357  * return self
11358  */
11359 
11360  /* function exit code */
11361  __pyx_L1_error:;
11362  __Pyx_XDECREF(__pyx_t_3);
11363  __Pyx_XDECREF(__pyx_t_4);
11364  __Pyx_XDECREF(__pyx_t_5);
11365  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11366  __pyx_r = NULL;
11367  __pyx_L0:;
11368  __Pyx_XDECREF(__pyx_v_have_slices);
11369  __Pyx_XDECREF(__pyx_v_indices);
11370  __Pyx_XGIVEREF(__pyx_r);
11371  __Pyx_RefNannyFinishContext();
11372  return __pyx_r;
11373 }
11374 
11375 /* "View.MemoryView":411
11376  * return self.convert_item_to_object(itemp)
11377  *
11378  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11379  * if self.view.readonly:
11380  * raise TypeError("Cannot assign to read-only memoryview")
11381  */
11382 
11383 /* Python wrapper */
11384 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
11385 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11386  int __pyx_r;
11387  __Pyx_RefNannyDeclarations
11388  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
11389  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11390 
11391  /* function exit code */
11392  __Pyx_RefNannyFinishContext();
11393  return __pyx_r;
11394 }
11395 
11396 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11397  PyObject *__pyx_v_have_slices = NULL;
11398  PyObject *__pyx_v_obj = NULL;
11399  int __pyx_r;
11400  __Pyx_RefNannyDeclarations
11401  int __pyx_t_1;
11402  PyObject *__pyx_t_2 = NULL;
11403  PyObject *__pyx_t_3 = NULL;
11404  PyObject *__pyx_t_4 = NULL;
11405  __Pyx_RefNannySetupContext("__setitem__", 0);
11406  __Pyx_INCREF(__pyx_v_index);
11407 
11408  /* "View.MemoryView":412
11409  *
11410  * def __setitem__(memoryview self, object index, object value):
11411  * if self.view.readonly: # <<<<<<<<<<<<<<
11412  * raise TypeError("Cannot assign to read-only memoryview")
11413  *
11414  */
11415  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11416  if (unlikely(__pyx_t_1)) {
11417 
11418  /* "View.MemoryView":413
11419  * def __setitem__(memoryview self, object index, object value):
11420  * if self.view.readonly:
11421  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
11422  *
11423  * have_slices, index = _unellipsify(index, self.view.ndim)
11424  */
11425  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 413, __pyx_L1_error)
11426  __Pyx_GOTREF(__pyx_t_2);
11427  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11428  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11429  __PYX_ERR(1, 413, __pyx_L1_error)
11430 
11431  /* "View.MemoryView":412
11432  *
11433  * def __setitem__(memoryview self, object index, object value):
11434  * if self.view.readonly: # <<<<<<<<<<<<<<
11435  * raise TypeError("Cannot assign to read-only memoryview")
11436  *
11437  */
11438  }
11439 
11440  /* "View.MemoryView":415
11441  * raise TypeError("Cannot assign to read-only memoryview")
11442  *
11443  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11444  *
11445  * if have_slices:
11446  */
11447  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
11448  __Pyx_GOTREF(__pyx_t_2);
11449  if (likely(__pyx_t_2 != Py_None)) {
11450  PyObject* sequence = __pyx_t_2;
11451  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11452  if (unlikely(size != 2)) {
11453  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11454  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11455  __PYX_ERR(1, 415, __pyx_L1_error)
11456  }
11457  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11458  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11459  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11460  __Pyx_INCREF(__pyx_t_3);
11461  __Pyx_INCREF(__pyx_t_4);
11462  #else
11463  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 415, __pyx_L1_error)
11464  __Pyx_GOTREF(__pyx_t_3);
11465  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 415, __pyx_L1_error)
11466  __Pyx_GOTREF(__pyx_t_4);
11467  #endif
11468  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11469  } else {
11470  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 415, __pyx_L1_error)
11471  }
11472  __pyx_v_have_slices = __pyx_t_3;
11473  __pyx_t_3 = 0;
11474  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11475  __pyx_t_4 = 0;
11476 
11477  /* "View.MemoryView":417
11478  * have_slices, index = _unellipsify(index, self.view.ndim)
11479  *
11480  * if have_slices: # <<<<<<<<<<<<<<
11481  * obj = self.is_slice(value)
11482  * if obj:
11483  */
11484  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 417, __pyx_L1_error)
11485  if (__pyx_t_1) {
11486 
11487  /* "View.MemoryView":418
11488  *
11489  * if have_slices:
11490  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
11491  * if obj:
11492  * self.setitem_slice_assignment(self[index], obj)
11493  */
11494  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11495  __Pyx_GOTREF(__pyx_t_2);
11496  __pyx_v_obj = __pyx_t_2;
11497  __pyx_t_2 = 0;
11498 
11499  /* "View.MemoryView":419
11500  * if have_slices:
11501  * obj = self.is_slice(value)
11502  * if obj: # <<<<<<<<<<<<<<
11503  * self.setitem_slice_assignment(self[index], obj)
11504  * else:
11505  */
11506  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 419, __pyx_L1_error)
11507  if (__pyx_t_1) {
11508 
11509  /* "View.MemoryView":420
11510  * obj = self.is_slice(value)
11511  * if obj:
11512  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
11513  * else:
11514  * self.setitem_slice_assign_scalar(self[index], value)
11515  */
11516  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11517  __Pyx_GOTREF(__pyx_t_2);
11518  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
11519  __Pyx_GOTREF(__pyx_t_4);
11520  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11521  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11522 
11523  /* "View.MemoryView":419
11524  * if have_slices:
11525  * obj = self.is_slice(value)
11526  * if obj: # <<<<<<<<<<<<<<
11527  * self.setitem_slice_assignment(self[index], obj)
11528  * else:
11529  */
11530  goto __pyx_L5;
11531  }
11532 
11533  /* "View.MemoryView":422
11534  * self.setitem_slice_assignment(self[index], obj)
11535  * else:
11536  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
11537  * else:
11538  * self.setitem_indexed(index, value)
11539  */
11540  /*else*/ {
11541  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
11542  __Pyx_GOTREF(__pyx_t_4);
11543  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 422, __pyx_L1_error)
11544  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
11545  __Pyx_GOTREF(__pyx_t_2);
11546  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11547  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11548  }
11549  __pyx_L5:;
11550 
11551  /* "View.MemoryView":417
11552  * have_slices, index = _unellipsify(index, self.view.ndim)
11553  *
11554  * if have_slices: # <<<<<<<<<<<<<<
11555  * obj = self.is_slice(value)
11556  * if obj:
11557  */
11558  goto __pyx_L4;
11559  }
11560 
11561  /* "View.MemoryView":424
11562  * self.setitem_slice_assign_scalar(self[index], value)
11563  * else:
11564  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
11565  *
11566  * cdef is_slice(self, obj):
11567  */
11568  /*else*/ {
11569  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
11570  __Pyx_GOTREF(__pyx_t_2);
11571  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11572  }
11573  __pyx_L4:;
11574 
11575  /* "View.MemoryView":411
11576  * return self.convert_item_to_object(itemp)
11577  *
11578  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11579  * if self.view.readonly:
11580  * raise TypeError("Cannot assign to read-only memoryview")
11581  */
11582 
11583  /* function exit code */
11584  __pyx_r = 0;
11585  goto __pyx_L0;
11586  __pyx_L1_error:;
11587  __Pyx_XDECREF(__pyx_t_2);
11588  __Pyx_XDECREF(__pyx_t_3);
11589  __Pyx_XDECREF(__pyx_t_4);
11590  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11591  __pyx_r = -1;
11592  __pyx_L0:;
11593  __Pyx_XDECREF(__pyx_v_have_slices);
11594  __Pyx_XDECREF(__pyx_v_obj);
11595  __Pyx_XDECREF(__pyx_v_index);
11596  __Pyx_RefNannyFinishContext();
11597  return __pyx_r;
11598 }
11599 
11600 /* "View.MemoryView":426
11601  * self.setitem_indexed(index, value)
11602  *
11603  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11604  * if not isinstance(obj, memoryview):
11605  * try:
11606  */
11607 
11608 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11609  PyObject *__pyx_r = NULL;
11610  __Pyx_RefNannyDeclarations
11611  int __pyx_t_1;
11612  int __pyx_t_2;
11613  PyObject *__pyx_t_3 = NULL;
11614  PyObject *__pyx_t_4 = NULL;
11615  PyObject *__pyx_t_5 = NULL;
11616  PyObject *__pyx_t_6 = NULL;
11617  PyObject *__pyx_t_7 = NULL;
11618  PyObject *__pyx_t_8 = NULL;
11619  int __pyx_t_9;
11620  __Pyx_RefNannySetupContext("is_slice", 0);
11621  __Pyx_INCREF(__pyx_v_obj);
11622 
11623  /* "View.MemoryView":427
11624  *
11625  * cdef is_slice(self, obj):
11626  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11627  * try:
11628  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11629  */
11630  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11631  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11632  if (__pyx_t_2) {
11633 
11634  /* "View.MemoryView":428
11635  * cdef is_slice(self, obj):
11636  * if not isinstance(obj, memoryview):
11637  * try: # <<<<<<<<<<<<<<
11638  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11639  * self.dtype_is_object)
11640  */
11641  {
11642  __Pyx_PyThreadState_declare
11643  __Pyx_PyThreadState_assign
11644  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11645  __Pyx_XGOTREF(__pyx_t_3);
11646  __Pyx_XGOTREF(__pyx_t_4);
11647  __Pyx_XGOTREF(__pyx_t_5);
11648  /*try:*/ {
11649 
11650  /* "View.MemoryView":429
11651  * if not isinstance(obj, memoryview):
11652  * try:
11653  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11654  * self.dtype_is_object)
11655  * except TypeError:
11656  */
11657  __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 429, __pyx_L4_error)
11658  __Pyx_GOTREF(__pyx_t_6);
11659 
11660  /* "View.MemoryView":430
11661  * try:
11662  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11663  * self.dtype_is_object) # <<<<<<<<<<<<<<
11664  * except TypeError:
11665  * return None
11666  */
11667  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 430, __pyx_L4_error)
11668  __Pyx_GOTREF(__pyx_t_7);
11669 
11670  /* "View.MemoryView":429
11671  * if not isinstance(obj, memoryview):
11672  * try:
11673  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11674  * self.dtype_is_object)
11675  * except TypeError:
11676  */
11677  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 429, __pyx_L4_error)
11678  __Pyx_GOTREF(__pyx_t_8);
11679  __Pyx_INCREF(__pyx_v_obj);
11680  __Pyx_GIVEREF(__pyx_v_obj);
11681  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11682  __Pyx_GIVEREF(__pyx_t_6);
11683  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11684  __Pyx_GIVEREF(__pyx_t_7);
11685  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11686  __pyx_t_6 = 0;
11687  __pyx_t_7 = 0;
11688  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 429, __pyx_L4_error)
11689  __Pyx_GOTREF(__pyx_t_7);
11690  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11691  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11692  __pyx_t_7 = 0;
11693 
11694  /* "View.MemoryView":428
11695  * cdef is_slice(self, obj):
11696  * if not isinstance(obj, memoryview):
11697  * try: # <<<<<<<<<<<<<<
11698  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11699  * self.dtype_is_object)
11700  */
11701  }
11702  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11703  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11704  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11705  goto __pyx_L9_try_end;
11706  __pyx_L4_error:;
11707  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11708  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11709  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11710 
11711  /* "View.MemoryView":431
11712  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11713  * self.dtype_is_object)
11714  * except TypeError: # <<<<<<<<<<<<<<
11715  * return None
11716  *
11717  */
11718  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11719  if (__pyx_t_9) {
11720  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11721  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 431, __pyx_L6_except_error)
11722  __Pyx_GOTREF(__pyx_t_7);
11723  __Pyx_GOTREF(__pyx_t_8);
11724  __Pyx_GOTREF(__pyx_t_6);
11725 
11726  /* "View.MemoryView":432
11727  * self.dtype_is_object)
11728  * except TypeError:
11729  * return None # <<<<<<<<<<<<<<
11730  *
11731  * return obj
11732  */
11733  __Pyx_XDECREF(__pyx_r);
11734  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11735  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11736  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11737  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11738  goto __pyx_L7_except_return;
11739  }
11740  goto __pyx_L6_except_error;
11741  __pyx_L6_except_error:;
11742 
11743  /* "View.MemoryView":428
11744  * cdef is_slice(self, obj):
11745  * if not isinstance(obj, memoryview):
11746  * try: # <<<<<<<<<<<<<<
11747  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11748  * self.dtype_is_object)
11749  */
11750  __Pyx_XGIVEREF(__pyx_t_3);
11751  __Pyx_XGIVEREF(__pyx_t_4);
11752  __Pyx_XGIVEREF(__pyx_t_5);
11753  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11754  goto __pyx_L1_error;
11755  __pyx_L7_except_return:;
11756  __Pyx_XGIVEREF(__pyx_t_3);
11757  __Pyx_XGIVEREF(__pyx_t_4);
11758  __Pyx_XGIVEREF(__pyx_t_5);
11759  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11760  goto __pyx_L0;
11761  __pyx_L9_try_end:;
11762  }
11763 
11764  /* "View.MemoryView":427
11765  *
11766  * cdef is_slice(self, obj):
11767  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11768  * try:
11769  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11770  */
11771  }
11772 
11773  /* "View.MemoryView":434
11774  * return None
11775  *
11776  * return obj # <<<<<<<<<<<<<<
11777  *
11778  * cdef setitem_slice_assignment(self, dst, src):
11779  */
11780  __Pyx_XDECREF(__pyx_r);
11781  __Pyx_INCREF(__pyx_v_obj);
11782  __pyx_r = __pyx_v_obj;
11783  goto __pyx_L0;
11784 
11785  /* "View.MemoryView":426
11786  * self.setitem_indexed(index, value)
11787  *
11788  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11789  * if not isinstance(obj, memoryview):
11790  * try:
11791  */
11792 
11793  /* function exit code */
11794  __pyx_L1_error:;
11795  __Pyx_XDECREF(__pyx_t_6);
11796  __Pyx_XDECREF(__pyx_t_7);
11797  __Pyx_XDECREF(__pyx_t_8);
11798  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11799  __pyx_r = 0;
11800  __pyx_L0:;
11801  __Pyx_XDECREF(__pyx_v_obj);
11802  __Pyx_XGIVEREF(__pyx_r);
11803  __Pyx_RefNannyFinishContext();
11804  return __pyx_r;
11805 }
11806 
11807 /* "View.MemoryView":436
11808  * return obj
11809  *
11810  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11811  * cdef __Pyx_memviewslice dst_slice
11812  * cdef __Pyx_memviewslice src_slice
11813  */
11814 
11815 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11816  __Pyx_memviewslice __pyx_v_dst_slice;
11817  __Pyx_memviewslice __pyx_v_src_slice;
11818  PyObject *__pyx_r = NULL;
11819  __Pyx_RefNannyDeclarations
11820  PyObject *__pyx_t_1 = NULL;
11821  int __pyx_t_2;
11822  int __pyx_t_3;
11823  int __pyx_t_4;
11824  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
11825 
11826  /* "View.MemoryView":440
11827  * cdef __Pyx_memviewslice src_slice
11828  *
11829  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11830  * get_slice_from_memview(dst, &dst_slice)[0],
11831  * src.ndim, dst.ndim, self.dtype_is_object)
11832  */
11833  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 440, __pyx_L1_error)
11834 
11835  /* "View.MemoryView":441
11836  *
11837  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11838  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
11839  * src.ndim, dst.ndim, self.dtype_is_object)
11840  *
11841  */
11842  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 441, __pyx_L1_error)
11843 
11844  /* "View.MemoryView":442
11845  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11846  * get_slice_from_memview(dst, &dst_slice)[0],
11847  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
11848  *
11849  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11850  */
11851  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
11852  __Pyx_GOTREF(__pyx_t_1);
11853  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 442, __pyx_L1_error)
11854  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11855  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
11856  __Pyx_GOTREF(__pyx_t_1);
11857  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 442, __pyx_L1_error)
11858  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11859 
11860  /* "View.MemoryView":440
11861  * cdef __Pyx_memviewslice src_slice
11862  *
11863  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11864  * get_slice_from_memview(dst, &dst_slice)[0],
11865  * src.ndim, dst.ndim, self.dtype_is_object)
11866  */
11867  __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 440, __pyx_L1_error)
11868 
11869  /* "View.MemoryView":436
11870  * return obj
11871  *
11872  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11873  * cdef __Pyx_memviewslice dst_slice
11874  * cdef __Pyx_memviewslice src_slice
11875  */
11876 
11877  /* function exit code */
11878  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11879  goto __pyx_L0;
11880  __pyx_L1_error:;
11881  __Pyx_XDECREF(__pyx_t_1);
11882  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11883  __pyx_r = 0;
11884  __pyx_L0:;
11885  __Pyx_XGIVEREF(__pyx_r);
11886  __Pyx_RefNannyFinishContext();
11887  return __pyx_r;
11888 }
11889 
11890 /* "View.MemoryView":444
11891  * src.ndim, dst.ndim, self.dtype_is_object)
11892  *
11893  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11894  * cdef int array[128]
11895  * cdef void *tmp = NULL
11896  */
11897 
11898 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
11899  int __pyx_v_array[0x80];
11900  void *__pyx_v_tmp;
11901  void *__pyx_v_item;
11902  __Pyx_memviewslice *__pyx_v_dst_slice;
11903  __Pyx_memviewslice __pyx_v_tmp_slice;
11904  PyObject *__pyx_r = NULL;
11905  __Pyx_RefNannyDeclarations
11906  int __pyx_t_1;
11907  PyObject *__pyx_t_2 = NULL;
11908  int __pyx_t_3;
11909  int __pyx_t_4;
11910  char const *__pyx_t_5;
11911  PyObject *__pyx_t_6 = NULL;
11912  PyObject *__pyx_t_7 = NULL;
11913  PyObject *__pyx_t_8 = NULL;
11914  PyObject *__pyx_t_9 = NULL;
11915  PyObject *__pyx_t_10 = NULL;
11916  PyObject *__pyx_t_11 = NULL;
11917  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
11918 
11919  /* "View.MemoryView":446
11920  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11921  * cdef int array[128]
11922  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
11923  * cdef void *item
11924  *
11925  */
11926  __pyx_v_tmp = NULL;
11927 
11928  /* "View.MemoryView":451
11929  * cdef __Pyx_memviewslice *dst_slice
11930  * cdef __Pyx_memviewslice tmp_slice
11931  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
11932  *
11933  * if <size_t>self.view.itemsize > sizeof(array):
11934  */
11935  __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
11936 
11937  /* "View.MemoryView":453
11938  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11939  *
11940  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11941  * tmp = PyMem_Malloc(self.view.itemsize)
11942  * if tmp == NULL:
11943  */
11944  __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
11945  if (__pyx_t_1) {
11946 
11947  /* "View.MemoryView":454
11948  *
11949  * if <size_t>self.view.itemsize > sizeof(array):
11950  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
11951  * if tmp == NULL:
11952  * raise MemoryError
11953  */
11954  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11955 
11956  /* "View.MemoryView":455
11957  * if <size_t>self.view.itemsize > sizeof(array):
11958  * tmp = PyMem_Malloc(self.view.itemsize)
11959  * if tmp == NULL: # <<<<<<<<<<<<<<
11960  * raise MemoryError
11961  * item = tmp
11962  */
11963  __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
11964  if (unlikely(__pyx_t_1)) {
11965 
11966  /* "View.MemoryView":456
11967  * tmp = PyMem_Malloc(self.view.itemsize)
11968  * if tmp == NULL:
11969  * raise MemoryError # <<<<<<<<<<<<<<
11970  * item = tmp
11971  * else:
11972  */
11973  PyErr_NoMemory(); __PYX_ERR(1, 456, __pyx_L1_error)
11974 
11975  /* "View.MemoryView":455
11976  * if <size_t>self.view.itemsize > sizeof(array):
11977  * tmp = PyMem_Malloc(self.view.itemsize)
11978  * if tmp == NULL: # <<<<<<<<<<<<<<
11979  * raise MemoryError
11980  * item = tmp
11981  */
11982  }
11983 
11984  /* "View.MemoryView":457
11985  * if tmp == NULL:
11986  * raise MemoryError
11987  * item = tmp # <<<<<<<<<<<<<<
11988  * else:
11989  * item = <void *> array
11990  */
11991  __pyx_v_item = __pyx_v_tmp;
11992 
11993  /* "View.MemoryView":453
11994  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11995  *
11996  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11997  * tmp = PyMem_Malloc(self.view.itemsize)
11998  * if tmp == NULL:
11999  */
12000  goto __pyx_L3;
12001  }
12002 
12003  /* "View.MemoryView":459
12004  * item = tmp
12005  * else:
12006  * item = <void *> array # <<<<<<<<<<<<<<
12007  *
12008  * try:
12009  */
12010  /*else*/ {
12011  __pyx_v_item = ((void *)__pyx_v_array);
12012  }
12013  __pyx_L3:;
12014 
12015  /* "View.MemoryView":461
12016  * item = <void *> array
12017  *
12018  * try: # <<<<<<<<<<<<<<
12019  * if self.dtype_is_object:
12020  * (<PyObject **> item)[0] = <PyObject *> value
12021  */
12022  /*try:*/ {
12023 
12024  /* "View.MemoryView":462
12025  *
12026  * try:
12027  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12028  * (<PyObject **> item)[0] = <PyObject *> value
12029  * else:
12030  */
12031  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
12032  if (__pyx_t_1) {
12033 
12034  /* "View.MemoryView":463
12035  * try:
12036  * if self.dtype_is_object:
12037  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
12038  * else:
12039  * self.assign_item_from_object(<char *> item, value)
12040  */
12041  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12042 
12043  /* "View.MemoryView":462
12044  *
12045  * try:
12046  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12047  * (<PyObject **> item)[0] = <PyObject *> value
12048  * else:
12049  */
12050  goto __pyx_L8;
12051  }
12052 
12053  /* "View.MemoryView":465
12054  * (<PyObject **> item)[0] = <PyObject *> value
12055  * else:
12056  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
12057  *
12058  *
12059  */
12060  /*else*/ {
12061  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 465, __pyx_L6_error)
12062  __Pyx_GOTREF(__pyx_t_2);
12063  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12064  }
12065  __pyx_L8:;
12066 
12067  /* "View.MemoryView":469
12068  *
12069  *
12070  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12071  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12072  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12073  */
12074  __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12075  if (__pyx_t_1) {
12076 
12077  /* "View.MemoryView":470
12078  *
12079  * if self.view.suboffsets != NULL:
12080  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
12081  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12082  * item, self.dtype_is_object)
12083  */
12084  __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 470, __pyx_L6_error)
12085  __Pyx_GOTREF(__pyx_t_2);
12086  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12087 
12088  /* "View.MemoryView":469
12089  *
12090  *
12091  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12092  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12093  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12094  */
12095  }
12096 
12097  /* "View.MemoryView":471
12098  * if self.view.suboffsets != NULL:
12099  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12100  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
12101  * item, self.dtype_is_object)
12102  * finally:
12103  */
12104  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12105  }
12106 
12107  /* "View.MemoryView":474
12108  * item, self.dtype_is_object)
12109  * finally:
12110  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
12111  *
12112  * cdef setitem_indexed(self, index, value):
12113  */
12114  /*finally:*/ {
12115  /*normal exit:*/{
12116  PyMem_Free(__pyx_v_tmp);
12117  goto __pyx_L7;
12118  }
12119  __pyx_L6_error:;
12120  /*exception exit:*/{
12121  __Pyx_PyThreadState_declare
12122  __Pyx_PyThreadState_assign
12123  __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
12124  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12125  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
12126  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
12127  __Pyx_XGOTREF(__pyx_t_6);
12128  __Pyx_XGOTREF(__pyx_t_7);
12129  __Pyx_XGOTREF(__pyx_t_8);
12130  __Pyx_XGOTREF(__pyx_t_9);
12131  __Pyx_XGOTREF(__pyx_t_10);
12132  __Pyx_XGOTREF(__pyx_t_11);
12133  __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
12134  {
12135  PyMem_Free(__pyx_v_tmp);
12136  }
12137  if (PY_MAJOR_VERSION >= 3) {
12138  __Pyx_XGIVEREF(__pyx_t_9);
12139  __Pyx_XGIVEREF(__pyx_t_10);
12140  __Pyx_XGIVEREF(__pyx_t_11);
12141  __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
12142  }
12143  __Pyx_XGIVEREF(__pyx_t_6);
12144  __Pyx_XGIVEREF(__pyx_t_7);
12145  __Pyx_XGIVEREF(__pyx_t_8);
12146  __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
12147  __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
12148  __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
12149  goto __pyx_L1_error;
12150  }
12151  __pyx_L7:;
12152  }
12153 
12154  /* "View.MemoryView":444
12155  * src.ndim, dst.ndim, self.dtype_is_object)
12156  *
12157  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12158  * cdef int array[128]
12159  * cdef void *tmp = NULL
12160  */
12161 
12162  /* function exit code */
12163  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12164  goto __pyx_L0;
12165  __pyx_L1_error:;
12166  __Pyx_XDECREF(__pyx_t_2);
12167  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12168  __pyx_r = 0;
12169  __pyx_L0:;
12170  __Pyx_XGIVEREF(__pyx_r);
12171  __Pyx_RefNannyFinishContext();
12172  return __pyx_r;
12173 }
12174 
12175 /* "View.MemoryView":476
12176  * PyMem_Free(tmp)
12177  *
12178  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12179  * cdef char *itemp = self.get_item_pointer(index)
12180  * self.assign_item_from_object(itemp, value)
12181  */
12182 
12183 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12184  char *__pyx_v_itemp;
12185  PyObject *__pyx_r = NULL;
12186  __Pyx_RefNannyDeclarations
12187  char *__pyx_t_1;
12188  PyObject *__pyx_t_2 = NULL;
12189  __Pyx_RefNannySetupContext("setitem_indexed", 0);
12190 
12191  /* "View.MemoryView":477
12192  *
12193  * cdef setitem_indexed(self, index, value):
12194  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
12195  * self.assign_item_from_object(itemp, value)
12196  *
12197  */
12198  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 477, __pyx_L1_error)
12199  __pyx_v_itemp = __pyx_t_1;
12200 
12201  /* "View.MemoryView":478
12202  * cdef setitem_indexed(self, index, value):
12203  * cdef char *itemp = self.get_item_pointer(index)
12204  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
12205  *
12206  * cdef convert_item_to_object(self, char *itemp):
12207  */
12208  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 478, __pyx_L1_error)
12209  __Pyx_GOTREF(__pyx_t_2);
12210  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12211 
12212  /* "View.MemoryView":476
12213  * PyMem_Free(tmp)
12214  *
12215  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12216  * cdef char *itemp = self.get_item_pointer(index)
12217  * self.assign_item_from_object(itemp, value)
12218  */
12219 
12220  /* function exit code */
12221  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12222  goto __pyx_L0;
12223  __pyx_L1_error:;
12224  __Pyx_XDECREF(__pyx_t_2);
12225  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12226  __pyx_r = 0;
12227  __pyx_L0:;
12228  __Pyx_XGIVEREF(__pyx_r);
12229  __Pyx_RefNannyFinishContext();
12230  return __pyx_r;
12231 }
12232 
12233 /* "View.MemoryView":480
12234  * self.assign_item_from_object(itemp, value)
12235  *
12236  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12237  * """Only used if instantiated manually by the user, or if Cython doesn't
12238  * know how to convert the type"""
12239  */
12240 
12241 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
12242  PyObject *__pyx_v_struct = NULL;
12243  PyObject *__pyx_v_bytesitem = 0;
12244  PyObject *__pyx_v_result = NULL;
12245  PyObject *__pyx_r = NULL;
12246  __Pyx_RefNannyDeclarations
12247  PyObject *__pyx_t_1 = NULL;
12248  PyObject *__pyx_t_2 = NULL;
12249  PyObject *__pyx_t_3 = NULL;
12250  PyObject *__pyx_t_4 = NULL;
12251  PyObject *__pyx_t_5 = NULL;
12252  PyObject *__pyx_t_6 = NULL;
12253  PyObject *__pyx_t_7 = NULL;
12254  int __pyx_t_8;
12255  PyObject *__pyx_t_9 = NULL;
12256  size_t __pyx_t_10;
12257  int __pyx_t_11;
12258  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
12259 
12260  /* "View.MemoryView":483
12261  * """Only used if instantiated manually by the user, or if Cython doesn't
12262  * know how to convert the type"""
12263  * import struct # <<<<<<<<<<<<<<
12264  * cdef bytes bytesitem
12265  *
12266  */
12267  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L1_error)
12268  __Pyx_GOTREF(__pyx_t_1);
12269  __pyx_v_struct = __pyx_t_1;
12270  __pyx_t_1 = 0;
12271 
12272  /* "View.MemoryView":486
12273  * cdef bytes bytesitem
12274  *
12275  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
12276  * try:
12277  * result = struct.unpack(self.view.format, bytesitem)
12278  */
12279  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 486, __pyx_L1_error)
12280  __Pyx_GOTREF(__pyx_t_1);
12281  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12282  __pyx_t_1 = 0;
12283 
12284  /* "View.MemoryView":487
12285  *
12286  * bytesitem = itemp[:self.view.itemsize]
12287  * try: # <<<<<<<<<<<<<<
12288  * result = struct.unpack(self.view.format, bytesitem)
12289  * except struct.error:
12290  */
12291  {
12292  __Pyx_PyThreadState_declare
12293  __Pyx_PyThreadState_assign
12294  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12295  __Pyx_XGOTREF(__pyx_t_2);
12296  __Pyx_XGOTREF(__pyx_t_3);
12297  __Pyx_XGOTREF(__pyx_t_4);
12298  /*try:*/ {
12299 
12300  /* "View.MemoryView":488
12301  * bytesitem = itemp[:self.view.itemsize]
12302  * try:
12303  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
12304  * except struct.error:
12305  * raise ValueError("Unable to convert item to object")
12306  */
12307  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 488, __pyx_L3_error)
12308  __Pyx_GOTREF(__pyx_t_5);
12309  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 488, __pyx_L3_error)
12310  __Pyx_GOTREF(__pyx_t_6);
12311  __pyx_t_7 = NULL;
12312  __pyx_t_8 = 0;
12313  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12314  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12315  if (likely(__pyx_t_7)) {
12316  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
12317  __Pyx_INCREF(__pyx_t_7);
12318  __Pyx_INCREF(function);
12319  __Pyx_DECREF_SET(__pyx_t_5, function);
12320  __pyx_t_8 = 1;
12321  }
12322  }
12323  #if CYTHON_FAST_PYCALL
12324  if (PyFunction_Check(__pyx_t_5)) {
12325  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12326  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
12327  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12328  __Pyx_GOTREF(__pyx_t_1);
12329  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12330  } else
12331  #endif
12332  #if CYTHON_FAST_PYCCALL
12333  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12334  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12335  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
12336  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12337  __Pyx_GOTREF(__pyx_t_1);
12338  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12339  } else
12340  #endif
12341  {
12342  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 488, __pyx_L3_error)
12343  __Pyx_GOTREF(__pyx_t_9);
12344  if (__pyx_t_7) {
12345  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12346  }
12347  __Pyx_GIVEREF(__pyx_t_6);
12348  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12349  __Pyx_INCREF(__pyx_v_bytesitem);
12350  __Pyx_GIVEREF(__pyx_v_bytesitem);
12351  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12352  __pyx_t_6 = 0;
12353  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
12354  __Pyx_GOTREF(__pyx_t_1);
12355  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12356  }
12357  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12358  __pyx_v_result = __pyx_t_1;
12359  __pyx_t_1 = 0;
12360 
12361  /* "View.MemoryView":487
12362  *
12363  * bytesitem = itemp[:self.view.itemsize]
12364  * try: # <<<<<<<<<<<<<<
12365  * result = struct.unpack(self.view.format, bytesitem)
12366  * except struct.error:
12367  */
12368  }
12369 
12370  /* "View.MemoryView":492
12371  * raise ValueError("Unable to convert item to object")
12372  * else:
12373  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12374  * return result[0]
12375  * return result
12376  */
12377  /*else:*/ {
12378  __pyx_t_10 = strlen(__pyx_v_self->view.format);
12379  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12380  if (__pyx_t_11) {
12381 
12382  /* "View.MemoryView":493
12383  * else:
12384  * if len(self.view.format) == 1:
12385  * return result[0] # <<<<<<<<<<<<<<
12386  * return result
12387  *
12388  */
12389  __Pyx_XDECREF(__pyx_r);
12390  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L5_except_error)
12391  __Pyx_GOTREF(__pyx_t_1);
12392  __pyx_r = __pyx_t_1;
12393  __pyx_t_1 = 0;
12394  goto __pyx_L6_except_return;
12395 
12396  /* "View.MemoryView":492
12397  * raise ValueError("Unable to convert item to object")
12398  * else:
12399  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12400  * return result[0]
12401  * return result
12402  */
12403  }
12404 
12405  /* "View.MemoryView":494
12406  * if len(self.view.format) == 1:
12407  * return result[0]
12408  * return result # <<<<<<<<<<<<<<
12409  *
12410  * cdef assign_item_from_object(self, char *itemp, object value):
12411  */
12412  __Pyx_XDECREF(__pyx_r);
12413  __Pyx_INCREF(__pyx_v_result);
12414  __pyx_r = __pyx_v_result;
12415  goto __pyx_L6_except_return;
12416  }
12417  __pyx_L3_error:;
12418  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12419  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12420  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12421  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12422  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12423 
12424  /* "View.MemoryView":489
12425  * try:
12426  * result = struct.unpack(self.view.format, bytesitem)
12427  * except struct.error: # <<<<<<<<<<<<<<
12428  * raise ValueError("Unable to convert item to object")
12429  * else:
12430  */
12431  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12432  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 489, __pyx_L5_except_error)
12433  __Pyx_GOTREF(__pyx_t_6);
12434  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12435  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12436  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12437  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12438  if (__pyx_t_8) {
12439  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12440  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 489, __pyx_L5_except_error)
12441  __Pyx_GOTREF(__pyx_t_9);
12442  __Pyx_GOTREF(__pyx_t_5);
12443  __Pyx_GOTREF(__pyx_t_1);
12444 
12445  /* "View.MemoryView":490
12446  * result = struct.unpack(self.view.format, bytesitem)
12447  * except struct.error:
12448  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
12449  * else:
12450  * if len(self.view.format) == 1:
12451  */
12452  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 490, __pyx_L5_except_error)
12453  __Pyx_GOTREF(__pyx_t_6);
12454  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12455  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12456  __PYX_ERR(1, 490, __pyx_L5_except_error)
12457  }
12458  goto __pyx_L5_except_error;
12459  __pyx_L5_except_error:;
12460 
12461  /* "View.MemoryView":487
12462  *
12463  * bytesitem = itemp[:self.view.itemsize]
12464  * try: # <<<<<<<<<<<<<<
12465  * result = struct.unpack(self.view.format, bytesitem)
12466  * except struct.error:
12467  */
12468  __Pyx_XGIVEREF(__pyx_t_2);
12469  __Pyx_XGIVEREF(__pyx_t_3);
12470  __Pyx_XGIVEREF(__pyx_t_4);
12471  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12472  goto __pyx_L1_error;
12473  __pyx_L6_except_return:;
12474  __Pyx_XGIVEREF(__pyx_t_2);
12475  __Pyx_XGIVEREF(__pyx_t_3);
12476  __Pyx_XGIVEREF(__pyx_t_4);
12477  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12478  goto __pyx_L0;
12479  }
12480 
12481  /* "View.MemoryView":480
12482  * self.assign_item_from_object(itemp, value)
12483  *
12484  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12485  * """Only used if instantiated manually by the user, or if Cython doesn't
12486  * know how to convert the type"""
12487  */
12488 
12489  /* function exit code */
12490  __pyx_L1_error:;
12491  __Pyx_XDECREF(__pyx_t_1);
12492  __Pyx_XDECREF(__pyx_t_5);
12493  __Pyx_XDECREF(__pyx_t_6);
12494  __Pyx_XDECREF(__pyx_t_7);
12495  __Pyx_XDECREF(__pyx_t_9);
12496  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12497  __pyx_r = 0;
12498  __pyx_L0:;
12499  __Pyx_XDECREF(__pyx_v_struct);
12500  __Pyx_XDECREF(__pyx_v_bytesitem);
12501  __Pyx_XDECREF(__pyx_v_result);
12502  __Pyx_XGIVEREF(__pyx_r);
12503  __Pyx_RefNannyFinishContext();
12504  return __pyx_r;
12505 }
12506 
12507 /* "View.MemoryView":496
12508  * return result
12509  *
12510  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12511  * """Only used if instantiated manually by the user, or if Cython doesn't
12512  * know how to convert the type"""
12513  */
12514 
12515 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12516  PyObject *__pyx_v_struct = NULL;
12517  char __pyx_v_c;
12518  PyObject *__pyx_v_bytesvalue = 0;
12519  Py_ssize_t __pyx_v_i;
12520  PyObject *__pyx_r = NULL;
12521  __Pyx_RefNannyDeclarations
12522  PyObject *__pyx_t_1 = NULL;
12523  int __pyx_t_2;
12524  int __pyx_t_3;
12525  PyObject *__pyx_t_4 = NULL;
12526  PyObject *__pyx_t_5 = NULL;
12527  PyObject *__pyx_t_6 = NULL;
12528  int __pyx_t_7;
12529  PyObject *__pyx_t_8 = NULL;
12530  Py_ssize_t __pyx_t_9;
12531  PyObject *__pyx_t_10 = NULL;
12532  char *__pyx_t_11;
12533  char *__pyx_t_12;
12534  char *__pyx_t_13;
12535  char *__pyx_t_14;
12536  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
12537 
12538  /* "View.MemoryView":499
12539  * """Only used if instantiated manually by the user, or if Cython doesn't
12540  * know how to convert the type"""
12541  * import struct # <<<<<<<<<<<<<<
12542  * cdef char c
12543  * cdef bytes bytesvalue
12544  */
12545  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error)
12546  __Pyx_GOTREF(__pyx_t_1);
12547  __pyx_v_struct = __pyx_t_1;
12548  __pyx_t_1 = 0;
12549 
12550  /* "View.MemoryView":504
12551  * cdef Py_ssize_t i
12552  *
12553  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12554  * bytesvalue = struct.pack(self.view.format, *value)
12555  * else:
12556  */
12557  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12558  __pyx_t_3 = (__pyx_t_2 != 0);
12559  if (__pyx_t_3) {
12560 
12561  /* "View.MemoryView":505
12562  *
12563  * if isinstance(value, tuple):
12564  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
12565  * else:
12566  * bytesvalue = struct.pack(self.view.format, value)
12567  */
12568  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 505, __pyx_L1_error)
12569  __Pyx_GOTREF(__pyx_t_1);
12570  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
12571  __Pyx_GOTREF(__pyx_t_4);
12572  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 505, __pyx_L1_error)
12573  __Pyx_GOTREF(__pyx_t_5);
12574  __Pyx_GIVEREF(__pyx_t_4);
12575  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12576  __pyx_t_4 = 0;
12577  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
12578  __Pyx_GOTREF(__pyx_t_4);
12579  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 505, __pyx_L1_error)
12580  __Pyx_GOTREF(__pyx_t_6);
12581  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12582  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12583  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
12584  __Pyx_GOTREF(__pyx_t_4);
12585  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12586  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12587  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 505, __pyx_L1_error)
12588  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12589  __pyx_t_4 = 0;
12590 
12591  /* "View.MemoryView":504
12592  * cdef Py_ssize_t i
12593  *
12594  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12595  * bytesvalue = struct.pack(self.view.format, *value)
12596  * else:
12597  */
12598  goto __pyx_L3;
12599  }
12600 
12601  /* "View.MemoryView":507
12602  * bytesvalue = struct.pack(self.view.format, *value)
12603  * else:
12604  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
12605  *
12606  * for i, c in enumerate(bytesvalue):
12607  */
12608  /*else*/ {
12609  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 507, __pyx_L1_error)
12610  __Pyx_GOTREF(__pyx_t_6);
12611  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 507, __pyx_L1_error)
12612  __Pyx_GOTREF(__pyx_t_1);
12613  __pyx_t_5 = NULL;
12614  __pyx_t_7 = 0;
12615  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12616  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12617  if (likely(__pyx_t_5)) {
12618  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12619  __Pyx_INCREF(__pyx_t_5);
12620  __Pyx_INCREF(function);
12621  __Pyx_DECREF_SET(__pyx_t_6, function);
12622  __pyx_t_7 = 1;
12623  }
12624  }
12625  #if CYTHON_FAST_PYCALL
12626  if (PyFunction_Check(__pyx_t_6)) {
12627  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12628  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
12629  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12630  __Pyx_GOTREF(__pyx_t_4);
12631  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12632  } else
12633  #endif
12634  #if CYTHON_FAST_PYCCALL
12635  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12636  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12637  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
12638  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12639  __Pyx_GOTREF(__pyx_t_4);
12640  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12641  } else
12642  #endif
12643  {
12644  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 507, __pyx_L1_error)
12645  __Pyx_GOTREF(__pyx_t_8);
12646  if (__pyx_t_5) {
12647  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12648  }
12649  __Pyx_GIVEREF(__pyx_t_1);
12650  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12651  __Pyx_INCREF(__pyx_v_value);
12652  __Pyx_GIVEREF(__pyx_v_value);
12653  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12654  __pyx_t_1 = 0;
12655  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
12656  __Pyx_GOTREF(__pyx_t_4);
12657  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12658  }
12659  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12660  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 507, __pyx_L1_error)
12661  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12662  __pyx_t_4 = 0;
12663  }
12664  __pyx_L3:;
12665 
12666  /* "View.MemoryView":509
12667  * bytesvalue = struct.pack(self.view.format, value)
12668  *
12669  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12670  * itemp[i] = c
12671  *
12672  */
12673  __pyx_t_9 = 0;
12674  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12675  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
12676  __PYX_ERR(1, 509, __pyx_L1_error)
12677  }
12678  __Pyx_INCREF(__pyx_v_bytesvalue);
12679  __pyx_t_10 = __pyx_v_bytesvalue;
12680  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12681  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12682  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12683  __pyx_t_11 = __pyx_t_14;
12684  __pyx_v_c = (__pyx_t_11[0]);
12685 
12686  /* "View.MemoryView":510
12687  *
12688  * for i, c in enumerate(bytesvalue):
12689  * itemp[i] = c # <<<<<<<<<<<<<<
12690  *
12691  * @cname('getbuffer')
12692  */
12693  __pyx_v_i = __pyx_t_9;
12694 
12695  /* "View.MemoryView":509
12696  * bytesvalue = struct.pack(self.view.format, value)
12697  *
12698  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12699  * itemp[i] = c
12700  *
12701  */
12702  __pyx_t_9 = (__pyx_t_9 + 1);
12703 
12704  /* "View.MemoryView":510
12705  *
12706  * for i, c in enumerate(bytesvalue):
12707  * itemp[i] = c # <<<<<<<<<<<<<<
12708  *
12709  * @cname('getbuffer')
12710  */
12711  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12712  }
12713  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12714 
12715  /* "View.MemoryView":496
12716  * return result
12717  *
12718  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12719  * """Only used if instantiated manually by the user, or if Cython doesn't
12720  * know how to convert the type"""
12721  */
12722 
12723  /* function exit code */
12724  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12725  goto __pyx_L0;
12726  __pyx_L1_error:;
12727  __Pyx_XDECREF(__pyx_t_1);
12728  __Pyx_XDECREF(__pyx_t_4);
12729  __Pyx_XDECREF(__pyx_t_5);
12730  __Pyx_XDECREF(__pyx_t_6);
12731  __Pyx_XDECREF(__pyx_t_8);
12732  __Pyx_XDECREF(__pyx_t_10);
12733  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12734  __pyx_r = 0;
12735  __pyx_L0:;
12736  __Pyx_XDECREF(__pyx_v_struct);
12737  __Pyx_XDECREF(__pyx_v_bytesvalue);
12738  __Pyx_XGIVEREF(__pyx_r);
12739  __Pyx_RefNannyFinishContext();
12740  return __pyx_r;
12741 }
12742 
12743 /* "View.MemoryView":513
12744  *
12745  * @cname('getbuffer')
12746  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12747  * if flags & PyBUF_WRITABLE and self.view.readonly:
12748  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12749  */
12750 
12751 /* Python wrapper */
12752 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
12753 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12754  int __pyx_r;
12755  __Pyx_RefNannyDeclarations
12756  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12757  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
12758 
12759  /* function exit code */
12760  __Pyx_RefNannyFinishContext();
12761  return __pyx_r;
12762 }
12763 
12764 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12765  int __pyx_r;
12766  __Pyx_RefNannyDeclarations
12767  int __pyx_t_1;
12768  int __pyx_t_2;
12769  PyObject *__pyx_t_3 = NULL;
12770  Py_ssize_t *__pyx_t_4;
12771  char *__pyx_t_5;
12772  void *__pyx_t_6;
12773  int __pyx_t_7;
12774  Py_ssize_t __pyx_t_8;
12775  if (__pyx_v_info == NULL) {
12776  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12777  return -1;
12778  }
12779  __Pyx_RefNannySetupContext("__getbuffer__", 0);
12780  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12781  __Pyx_GIVEREF(__pyx_v_info->obj);
12782 
12783  /* "View.MemoryView":514
12784  * @cname('getbuffer')
12785  * def __getbuffer__(self, Py_buffer *info, int flags):
12786  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12787  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12788  *
12789  */
12790  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12791  if (__pyx_t_2) {
12792  } else {
12793  __pyx_t_1 = __pyx_t_2;
12794  goto __pyx_L4_bool_binop_done;
12795  }
12796  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12797  __pyx_t_1 = __pyx_t_2;
12798  __pyx_L4_bool_binop_done:;
12799  if (unlikely(__pyx_t_1)) {
12800 
12801  /* "View.MemoryView":515
12802  * def __getbuffer__(self, Py_buffer *info, int flags):
12803  * if flags & PyBUF_WRITABLE and self.view.readonly:
12804  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
12805  *
12806  * if flags & PyBUF_STRIDES:
12807  */
12808  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 515, __pyx_L1_error)
12809  __Pyx_GOTREF(__pyx_t_3);
12810  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12811  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12812  __PYX_ERR(1, 515, __pyx_L1_error)
12813 
12814  /* "View.MemoryView":514
12815  * @cname('getbuffer')
12816  * def __getbuffer__(self, Py_buffer *info, int flags):
12817  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12818  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12819  *
12820  */
12821  }
12822 
12823  /* "View.MemoryView":517
12824  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12825  *
12826  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12827  * info.shape = self.view.shape
12828  * else:
12829  */
12830  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12831  if (__pyx_t_1) {
12832 
12833  /* "View.MemoryView":518
12834  *
12835  * if flags & PyBUF_STRIDES:
12836  * info.shape = self.view.shape # <<<<<<<<<<<<<<
12837  * else:
12838  * info.shape = NULL
12839  */
12840  __pyx_t_4 = __pyx_v_self->view.shape;
12841  __pyx_v_info->shape = __pyx_t_4;
12842 
12843  /* "View.MemoryView":517
12844  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12845  *
12846  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12847  * info.shape = self.view.shape
12848  * else:
12849  */
12850  goto __pyx_L6;
12851  }
12852 
12853  /* "View.MemoryView":520
12854  * info.shape = self.view.shape
12855  * else:
12856  * info.shape = NULL # <<<<<<<<<<<<<<
12857  *
12858  * if flags & PyBUF_STRIDES:
12859  */
12860  /*else*/ {
12861  __pyx_v_info->shape = NULL;
12862  }
12863  __pyx_L6:;
12864 
12865  /* "View.MemoryView":522
12866  * info.shape = NULL
12867  *
12868  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12869  * info.strides = self.view.strides
12870  * else:
12871  */
12872  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12873  if (__pyx_t_1) {
12874 
12875  /* "View.MemoryView":523
12876  *
12877  * if flags & PyBUF_STRIDES:
12878  * info.strides = self.view.strides # <<<<<<<<<<<<<<
12879  * else:
12880  * info.strides = NULL
12881  */
12882  __pyx_t_4 = __pyx_v_self->view.strides;
12883  __pyx_v_info->strides = __pyx_t_4;
12884 
12885  /* "View.MemoryView":522
12886  * info.shape = NULL
12887  *
12888  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12889  * info.strides = self.view.strides
12890  * else:
12891  */
12892  goto __pyx_L7;
12893  }
12894 
12895  /* "View.MemoryView":525
12896  * info.strides = self.view.strides
12897  * else:
12898  * info.strides = NULL # <<<<<<<<<<<<<<
12899  *
12900  * if flags & PyBUF_INDIRECT:
12901  */
12902  /*else*/ {
12903  __pyx_v_info->strides = NULL;
12904  }
12905  __pyx_L7:;
12906 
12907  /* "View.MemoryView":527
12908  * info.strides = NULL
12909  *
12910  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12911  * info.suboffsets = self.view.suboffsets
12912  * else:
12913  */
12914  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12915  if (__pyx_t_1) {
12916 
12917  /* "View.MemoryView":528
12918  *
12919  * if flags & PyBUF_INDIRECT:
12920  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
12921  * else:
12922  * info.suboffsets = NULL
12923  */
12924  __pyx_t_4 = __pyx_v_self->view.suboffsets;
12925  __pyx_v_info->suboffsets = __pyx_t_4;
12926 
12927  /* "View.MemoryView":527
12928  * info.strides = NULL
12929  *
12930  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12931  * info.suboffsets = self.view.suboffsets
12932  * else:
12933  */
12934  goto __pyx_L8;
12935  }
12936 
12937  /* "View.MemoryView":530
12938  * info.suboffsets = self.view.suboffsets
12939  * else:
12940  * info.suboffsets = NULL # <<<<<<<<<<<<<<
12941  *
12942  * if flags & PyBUF_FORMAT:
12943  */
12944  /*else*/ {
12945  __pyx_v_info->suboffsets = NULL;
12946  }
12947  __pyx_L8:;
12948 
12949  /* "View.MemoryView":532
12950  * info.suboffsets = NULL
12951  *
12952  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12953  * info.format = self.view.format
12954  * else:
12955  */
12956  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12957  if (__pyx_t_1) {
12958 
12959  /* "View.MemoryView":533
12960  *
12961  * if flags & PyBUF_FORMAT:
12962  * info.format = self.view.format # <<<<<<<<<<<<<<
12963  * else:
12964  * info.format = NULL
12965  */
12966  __pyx_t_5 = __pyx_v_self->view.format;
12967  __pyx_v_info->format = __pyx_t_5;
12968 
12969  /* "View.MemoryView":532
12970  * info.suboffsets = NULL
12971  *
12972  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12973  * info.format = self.view.format
12974  * else:
12975  */
12976  goto __pyx_L9;
12977  }
12978 
12979  /* "View.MemoryView":535
12980  * info.format = self.view.format
12981  * else:
12982  * info.format = NULL # <<<<<<<<<<<<<<
12983  *
12984  * info.buf = self.view.buf
12985  */
12986  /*else*/ {
12987  __pyx_v_info->format = NULL;
12988  }
12989  __pyx_L9:;
12990 
12991  /* "View.MemoryView":537
12992  * info.format = NULL
12993  *
12994  * info.buf = self.view.buf # <<<<<<<<<<<<<<
12995  * info.ndim = self.view.ndim
12996  * info.itemsize = self.view.itemsize
12997  */
12998  __pyx_t_6 = __pyx_v_self->view.buf;
12999  __pyx_v_info->buf = __pyx_t_6;
13000 
13001  /* "View.MemoryView":538
13002  *
13003  * info.buf = self.view.buf
13004  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
13005  * info.itemsize = self.view.itemsize
13006  * info.len = self.view.len
13007  */
13008  __pyx_t_7 = __pyx_v_self->view.ndim;
13009  __pyx_v_info->ndim = __pyx_t_7;
13010 
13011  /* "View.MemoryView":539
13012  * info.buf = self.view.buf
13013  * info.ndim = self.view.ndim
13014  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
13015  * info.len = self.view.len
13016  * info.readonly = self.view.readonly
13017  */
13018  __pyx_t_8 = __pyx_v_self->view.itemsize;
13019  __pyx_v_info->itemsize = __pyx_t_8;
13020 
13021  /* "View.MemoryView":540
13022  * info.ndim = self.view.ndim
13023  * info.itemsize = self.view.itemsize
13024  * info.len = self.view.len # <<<<<<<<<<<<<<
13025  * info.readonly = self.view.readonly
13026  * info.obj = self
13027  */
13028  __pyx_t_8 = __pyx_v_self->view.len;
13029  __pyx_v_info->len = __pyx_t_8;
13030 
13031  /* "View.MemoryView":541
13032  * info.itemsize = self.view.itemsize
13033  * info.len = self.view.len
13034  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
13035  * info.obj = self
13036  *
13037  */
13038  __pyx_t_1 = __pyx_v_self->view.readonly;
13039  __pyx_v_info->readonly = __pyx_t_1;
13040 
13041  /* "View.MemoryView":542
13042  * info.len = self.view.len
13043  * info.readonly = self.view.readonly
13044  * info.obj = self # <<<<<<<<<<<<<<
13045  *
13046  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
13047  */
13048  __Pyx_INCREF(((PyObject *)__pyx_v_self));
13049  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13050  __Pyx_GOTREF(__pyx_v_info->obj);
13051  __Pyx_DECREF(__pyx_v_info->obj);
13052  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13053 
13054  /* "View.MemoryView":513
13055  *
13056  * @cname('getbuffer')
13057  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13058  * if flags & PyBUF_WRITABLE and self.view.readonly:
13059  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13060  */
13061 
13062  /* function exit code */
13063  __pyx_r = 0;
13064  goto __pyx_L0;
13065  __pyx_L1_error:;
13066  __Pyx_XDECREF(__pyx_t_3);
13067  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13068  __pyx_r = -1;
13069  if (__pyx_v_info->obj != NULL) {
13070  __Pyx_GOTREF(__pyx_v_info->obj);
13071  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13072  }
13073  goto __pyx_L2;
13074  __pyx_L0:;
13075  if (__pyx_v_info->obj == Py_None) {
13076  __Pyx_GOTREF(__pyx_v_info->obj);
13077  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13078  }
13079  __pyx_L2:;
13080  __Pyx_RefNannyFinishContext();
13081  return __pyx_r;
13082 }
13083 
13084 /* "View.MemoryView":548
13085  *
13086  * @property
13087  * def T(self): # <<<<<<<<<<<<<<
13088  * cdef _memoryviewslice result = memoryview_copy(self)
13089  * transpose_memslice(&result.from_slice)
13090  */
13091 
13092 /* Python wrapper */
13093 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
13094 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13095  PyObject *__pyx_r = 0;
13096  __Pyx_RefNannyDeclarations
13097  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13098  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13099 
13100  /* function exit code */
13101  __Pyx_RefNannyFinishContext();
13102  return __pyx_r;
13103 }
13104 
13105 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13106  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13107  PyObject *__pyx_r = NULL;
13108  __Pyx_RefNannyDeclarations
13109  PyObject *__pyx_t_1 = NULL;
13110  int __pyx_t_2;
13111  __Pyx_RefNannySetupContext("__get__", 0);
13112 
13113  /* "View.MemoryView":549
13114  * @property
13115  * def T(self):
13116  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
13117  * transpose_memslice(&result.from_slice)
13118  * return result
13119  */
13120  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
13121  __Pyx_GOTREF(__pyx_t_1);
13122  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 549, __pyx_L1_error)
13123  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13124  __pyx_t_1 = 0;
13125 
13126  /* "View.MemoryView":550
13127  * def T(self):
13128  * cdef _memoryviewslice result = memoryview_copy(self)
13129  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
13130  * return result
13131  *
13132  */
13133  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 550, __pyx_L1_error)
13134 
13135  /* "View.MemoryView":551
13136  * cdef _memoryviewslice result = memoryview_copy(self)
13137  * transpose_memslice(&result.from_slice)
13138  * return result # <<<<<<<<<<<<<<
13139  *
13140  * @property
13141  */
13142  __Pyx_XDECREF(__pyx_r);
13143  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13144  __pyx_r = ((PyObject *)__pyx_v_result);
13145  goto __pyx_L0;
13146 
13147  /* "View.MemoryView":548
13148  *
13149  * @property
13150  * def T(self): # <<<<<<<<<<<<<<
13151  * cdef _memoryviewslice result = memoryview_copy(self)
13152  * transpose_memslice(&result.from_slice)
13153  */
13154 
13155  /* function exit code */
13156  __pyx_L1_error:;
13157  __Pyx_XDECREF(__pyx_t_1);
13158  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13159  __pyx_r = NULL;
13160  __pyx_L0:;
13161  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13162  __Pyx_XGIVEREF(__pyx_r);
13163  __Pyx_RefNannyFinishContext();
13164  return __pyx_r;
13165 }
13166 
13167 /* "View.MemoryView":554
13168  *
13169  * @property
13170  * def base(self): # <<<<<<<<<<<<<<
13171  * return self.obj
13172  *
13173  */
13174 
13175 /* Python wrapper */
13176 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
13177 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13178  PyObject *__pyx_r = 0;
13179  __Pyx_RefNannyDeclarations
13180  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13181  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13182 
13183  /* function exit code */
13184  __Pyx_RefNannyFinishContext();
13185  return __pyx_r;
13186 }
13187 
13188 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13189  PyObject *__pyx_r = NULL;
13190  __Pyx_RefNannyDeclarations
13191  __Pyx_RefNannySetupContext("__get__", 0);
13192 
13193  /* "View.MemoryView":555
13194  * @property
13195  * def base(self):
13196  * return self.obj # <<<<<<<<<<<<<<
13197  *
13198  * @property
13199  */
13200  __Pyx_XDECREF(__pyx_r);
13201  __Pyx_INCREF(__pyx_v_self->obj);
13202  __pyx_r = __pyx_v_self->obj;
13203  goto __pyx_L0;
13204 
13205  /* "View.MemoryView":554
13206  *
13207  * @property
13208  * def base(self): # <<<<<<<<<<<<<<
13209  * return self.obj
13210  *
13211  */
13212 
13213  /* function exit code */
13214  __pyx_L0:;
13215  __Pyx_XGIVEREF(__pyx_r);
13216  __Pyx_RefNannyFinishContext();
13217  return __pyx_r;
13218 }
13219 
13220 /* "View.MemoryView":558
13221  *
13222  * @property
13223  * def shape(self): # <<<<<<<<<<<<<<
13224  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13225  *
13226  */
13227 
13228 /* Python wrapper */
13229 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
13230 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13231  PyObject *__pyx_r = 0;
13232  __Pyx_RefNannyDeclarations
13233  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13234  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13235 
13236  /* function exit code */
13237  __Pyx_RefNannyFinishContext();
13238  return __pyx_r;
13239 }
13240 
13241 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13242  Py_ssize_t __pyx_v_length;
13243  PyObject *__pyx_r = NULL;
13244  __Pyx_RefNannyDeclarations
13245  PyObject *__pyx_t_1 = NULL;
13246  Py_ssize_t *__pyx_t_2;
13247  Py_ssize_t *__pyx_t_3;
13248  Py_ssize_t *__pyx_t_4;
13249  PyObject *__pyx_t_5 = NULL;
13250  __Pyx_RefNannySetupContext("__get__", 0);
13251 
13252  /* "View.MemoryView":559
13253  * @property
13254  * def shape(self):
13255  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
13256  *
13257  * @property
13258  */
13259  __Pyx_XDECREF(__pyx_r);
13260  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
13261  __Pyx_GOTREF(__pyx_t_1);
13262  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13263  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13264  __pyx_t_2 = __pyx_t_4;
13265  __pyx_v_length = (__pyx_t_2[0]);
13266  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 559, __pyx_L1_error)
13267  __Pyx_GOTREF(__pyx_t_5);
13268  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 559, __pyx_L1_error)
13269  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13270  }
13271  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 559, __pyx_L1_error)
13272  __Pyx_GOTREF(__pyx_t_5);
13273  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13274  __pyx_r = __pyx_t_5;
13275  __pyx_t_5 = 0;
13276  goto __pyx_L0;
13277 
13278  /* "View.MemoryView":558
13279  *
13280  * @property
13281  * def shape(self): # <<<<<<<<<<<<<<
13282  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13283  *
13284  */
13285 
13286  /* function exit code */
13287  __pyx_L1_error:;
13288  __Pyx_XDECREF(__pyx_t_1);
13289  __Pyx_XDECREF(__pyx_t_5);
13290  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13291  __pyx_r = NULL;
13292  __pyx_L0:;
13293  __Pyx_XGIVEREF(__pyx_r);
13294  __Pyx_RefNannyFinishContext();
13295  return __pyx_r;
13296 }
13297 
13298 /* "View.MemoryView":562
13299  *
13300  * @property
13301  * def strides(self): # <<<<<<<<<<<<<<
13302  * if self.view.strides == NULL:
13303  *
13304  */
13305 
13306 /* Python wrapper */
13307 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
13308 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13309  PyObject *__pyx_r = 0;
13310  __Pyx_RefNannyDeclarations
13311  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13312  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13313 
13314  /* function exit code */
13315  __Pyx_RefNannyFinishContext();
13316  return __pyx_r;
13317 }
13318 
13319 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13320  Py_ssize_t __pyx_v_stride;
13321  PyObject *__pyx_r = NULL;
13322  __Pyx_RefNannyDeclarations
13323  int __pyx_t_1;
13324  PyObject *__pyx_t_2 = NULL;
13325  Py_ssize_t *__pyx_t_3;
13326  Py_ssize_t *__pyx_t_4;
13327  Py_ssize_t *__pyx_t_5;
13328  PyObject *__pyx_t_6 = NULL;
13329  __Pyx_RefNannySetupContext("__get__", 0);
13330 
13331  /* "View.MemoryView":563
13332  * @property
13333  * def strides(self):
13334  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13335  *
13336  * raise ValueError("Buffer view does not expose strides")
13337  */
13338  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13339  if (unlikely(__pyx_t_1)) {
13340 
13341  /* "View.MemoryView":565
13342  * if self.view.strides == NULL:
13343  *
13344  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
13345  *
13346  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
13347  */
13348  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error)
13349  __Pyx_GOTREF(__pyx_t_2);
13350  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13351  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13352  __PYX_ERR(1, 565, __pyx_L1_error)
13353 
13354  /* "View.MemoryView":563
13355  * @property
13356  * def strides(self):
13357  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13358  *
13359  * raise ValueError("Buffer view does not expose strides")
13360  */
13361  }
13362 
13363  /* "View.MemoryView":567
13364  * raise ValueError("Buffer view does not expose strides")
13365  *
13366  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
13367  *
13368  * @property
13369  */
13370  __Pyx_XDECREF(__pyx_r);
13371  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 567, __pyx_L1_error)
13372  __Pyx_GOTREF(__pyx_t_2);
13373  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13374  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13375  __pyx_t_3 = __pyx_t_5;
13376  __pyx_v_stride = (__pyx_t_3[0]);
13377  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 567, __pyx_L1_error)
13378  __Pyx_GOTREF(__pyx_t_6);
13379  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 567, __pyx_L1_error)
13380  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13381  }
13382  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 567, __pyx_L1_error)
13383  __Pyx_GOTREF(__pyx_t_6);
13384  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13385  __pyx_r = __pyx_t_6;
13386  __pyx_t_6 = 0;
13387  goto __pyx_L0;
13388 
13389  /* "View.MemoryView":562
13390  *
13391  * @property
13392  * def strides(self): # <<<<<<<<<<<<<<
13393  * if self.view.strides == NULL:
13394  *
13395  */
13396 
13397  /* function exit code */
13398  __pyx_L1_error:;
13399  __Pyx_XDECREF(__pyx_t_2);
13400  __Pyx_XDECREF(__pyx_t_6);
13401  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13402  __pyx_r = NULL;
13403  __pyx_L0:;
13404  __Pyx_XGIVEREF(__pyx_r);
13405  __Pyx_RefNannyFinishContext();
13406  return __pyx_r;
13407 }
13408 
13409 /* "View.MemoryView":570
13410  *
13411  * @property
13412  * def suboffsets(self): # <<<<<<<<<<<<<<
13413  * if self.view.suboffsets == NULL:
13414  * return (-1,) * self.view.ndim
13415  */
13416 
13417 /* Python wrapper */
13418 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
13419 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13420  PyObject *__pyx_r = 0;
13421  __Pyx_RefNannyDeclarations
13422  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13423  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13424 
13425  /* function exit code */
13426  __Pyx_RefNannyFinishContext();
13427  return __pyx_r;
13428 }
13429 
13430 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13431  Py_ssize_t __pyx_v_suboffset;
13432  PyObject *__pyx_r = NULL;
13433  __Pyx_RefNannyDeclarations
13434  int __pyx_t_1;
13435  PyObject *__pyx_t_2 = NULL;
13436  PyObject *__pyx_t_3 = NULL;
13437  Py_ssize_t *__pyx_t_4;
13438  Py_ssize_t *__pyx_t_5;
13439  Py_ssize_t *__pyx_t_6;
13440  __Pyx_RefNannySetupContext("__get__", 0);
13441 
13442  /* "View.MemoryView":571
13443  * @property
13444  * def suboffsets(self):
13445  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13446  * return (-1,) * self.view.ndim
13447  *
13448  */
13449  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13450  if (__pyx_t_1) {
13451 
13452  /* "View.MemoryView":572
13453  * def suboffsets(self):
13454  * if self.view.suboffsets == NULL:
13455  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
13456  *
13457  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
13458  */
13459  __Pyx_XDECREF(__pyx_r);
13460  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13461  __Pyx_GOTREF(__pyx_t_2);
13462  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__26, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 572, __pyx_L1_error)
13463  __Pyx_GOTREF(__pyx_t_3);
13464  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13465  __pyx_r = __pyx_t_3;
13466  __pyx_t_3 = 0;
13467  goto __pyx_L0;
13468 
13469  /* "View.MemoryView":571
13470  * @property
13471  * def suboffsets(self):
13472  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13473  * return (-1,) * self.view.ndim
13474  *
13475  */
13476  }
13477 
13478  /* "View.MemoryView":574
13479  * return (-1,) * self.view.ndim
13480  *
13481  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
13482  *
13483  * @property
13484  */
13485  __Pyx_XDECREF(__pyx_r);
13486  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 574, __pyx_L1_error)
13487  __Pyx_GOTREF(__pyx_t_3);
13488  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13489  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13490  __pyx_t_4 = __pyx_t_6;
13491  __pyx_v_suboffset = (__pyx_t_4[0]);
13492  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
13493  __Pyx_GOTREF(__pyx_t_2);
13494  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 574, __pyx_L1_error)
13495  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13496  }
13497  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
13498  __Pyx_GOTREF(__pyx_t_2);
13499  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13500  __pyx_r = __pyx_t_2;
13501  __pyx_t_2 = 0;
13502  goto __pyx_L0;
13503 
13504  /* "View.MemoryView":570
13505  *
13506  * @property
13507  * def suboffsets(self): # <<<<<<<<<<<<<<
13508  * if self.view.suboffsets == NULL:
13509  * return (-1,) * self.view.ndim
13510  */
13511 
13512  /* function exit code */
13513  __pyx_L1_error:;
13514  __Pyx_XDECREF(__pyx_t_2);
13515  __Pyx_XDECREF(__pyx_t_3);
13516  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13517  __pyx_r = NULL;
13518  __pyx_L0:;
13519  __Pyx_XGIVEREF(__pyx_r);
13520  __Pyx_RefNannyFinishContext();
13521  return __pyx_r;
13522 }
13523 
13524 /* "View.MemoryView":577
13525  *
13526  * @property
13527  * def ndim(self): # <<<<<<<<<<<<<<
13528  * return self.view.ndim
13529  *
13530  */
13531 
13532 /* Python wrapper */
13533 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
13534 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13535  PyObject *__pyx_r = 0;
13536  __Pyx_RefNannyDeclarations
13537  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13538  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13539 
13540  /* function exit code */
13541  __Pyx_RefNannyFinishContext();
13542  return __pyx_r;
13543 }
13544 
13545 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13546  PyObject *__pyx_r = NULL;
13547  __Pyx_RefNannyDeclarations
13548  PyObject *__pyx_t_1 = NULL;
13549  __Pyx_RefNannySetupContext("__get__", 0);
13550 
13551  /* "View.MemoryView":578
13552  * @property
13553  * def ndim(self):
13554  * return self.view.ndim # <<<<<<<<<<<<<<
13555  *
13556  * @property
13557  */
13558  __Pyx_XDECREF(__pyx_r);
13559  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 578, __pyx_L1_error)
13560  __Pyx_GOTREF(__pyx_t_1);
13561  __pyx_r = __pyx_t_1;
13562  __pyx_t_1 = 0;
13563  goto __pyx_L0;
13564 
13565  /* "View.MemoryView":577
13566  *
13567  * @property
13568  * def ndim(self): # <<<<<<<<<<<<<<
13569  * return self.view.ndim
13570  *
13571  */
13572 
13573  /* function exit code */
13574  __pyx_L1_error:;
13575  __Pyx_XDECREF(__pyx_t_1);
13576  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13577  __pyx_r = NULL;
13578  __pyx_L0:;
13579  __Pyx_XGIVEREF(__pyx_r);
13580  __Pyx_RefNannyFinishContext();
13581  return __pyx_r;
13582 }
13583 
13584 /* "View.MemoryView":581
13585  *
13586  * @property
13587  * def itemsize(self): # <<<<<<<<<<<<<<
13588  * return self.view.itemsize
13589  *
13590  */
13591 
13592 /* Python wrapper */
13593 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
13594 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13595  PyObject *__pyx_r = 0;
13596  __Pyx_RefNannyDeclarations
13597  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13598  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13599 
13600  /* function exit code */
13601  __Pyx_RefNannyFinishContext();
13602  return __pyx_r;
13603 }
13604 
13605 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13606  PyObject *__pyx_r = NULL;
13607  __Pyx_RefNannyDeclarations
13608  PyObject *__pyx_t_1 = NULL;
13609  __Pyx_RefNannySetupContext("__get__", 0);
13610 
13611  /* "View.MemoryView":582
13612  * @property
13613  * def itemsize(self):
13614  * return self.view.itemsize # <<<<<<<<<<<<<<
13615  *
13616  * @property
13617  */
13618  __Pyx_XDECREF(__pyx_r);
13619  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 582, __pyx_L1_error)
13620  __Pyx_GOTREF(__pyx_t_1);
13621  __pyx_r = __pyx_t_1;
13622  __pyx_t_1 = 0;
13623  goto __pyx_L0;
13624 
13625  /* "View.MemoryView":581
13626  *
13627  * @property
13628  * def itemsize(self): # <<<<<<<<<<<<<<
13629  * return self.view.itemsize
13630  *
13631  */
13632 
13633  /* function exit code */
13634  __pyx_L1_error:;
13635  __Pyx_XDECREF(__pyx_t_1);
13636  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13637  __pyx_r = NULL;
13638  __pyx_L0:;
13639  __Pyx_XGIVEREF(__pyx_r);
13640  __Pyx_RefNannyFinishContext();
13641  return __pyx_r;
13642 }
13643 
13644 /* "View.MemoryView":585
13645  *
13646  * @property
13647  * def nbytes(self): # <<<<<<<<<<<<<<
13648  * return self.size * self.view.itemsize
13649  *
13650  */
13651 
13652 /* Python wrapper */
13653 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
13654 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13655  PyObject *__pyx_r = 0;
13656  __Pyx_RefNannyDeclarations
13657  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13658  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13659 
13660  /* function exit code */
13661  __Pyx_RefNannyFinishContext();
13662  return __pyx_r;
13663 }
13664 
13665 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13666  PyObject *__pyx_r = NULL;
13667  __Pyx_RefNannyDeclarations
13668  PyObject *__pyx_t_1 = NULL;
13669  PyObject *__pyx_t_2 = NULL;
13670  PyObject *__pyx_t_3 = NULL;
13671  __Pyx_RefNannySetupContext("__get__", 0);
13672 
13673  /* "View.MemoryView":586
13674  * @property
13675  * def nbytes(self):
13676  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
13677  *
13678  * @property
13679  */
13680  __Pyx_XDECREF(__pyx_r);
13681  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 586, __pyx_L1_error)
13682  __Pyx_GOTREF(__pyx_t_1);
13683  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 586, __pyx_L1_error)
13684  __Pyx_GOTREF(__pyx_t_2);
13685  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 586, __pyx_L1_error)
13686  __Pyx_GOTREF(__pyx_t_3);
13687  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13688  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13689  __pyx_r = __pyx_t_3;
13690  __pyx_t_3 = 0;
13691  goto __pyx_L0;
13692 
13693  /* "View.MemoryView":585
13694  *
13695  * @property
13696  * def nbytes(self): # <<<<<<<<<<<<<<
13697  * return self.size * self.view.itemsize
13698  *
13699  */
13700 
13701  /* function exit code */
13702  __pyx_L1_error:;
13703  __Pyx_XDECREF(__pyx_t_1);
13704  __Pyx_XDECREF(__pyx_t_2);
13705  __Pyx_XDECREF(__pyx_t_3);
13706  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13707  __pyx_r = NULL;
13708  __pyx_L0:;
13709  __Pyx_XGIVEREF(__pyx_r);
13710  __Pyx_RefNannyFinishContext();
13711  return __pyx_r;
13712 }
13713 
13714 /* "View.MemoryView":589
13715  *
13716  * @property
13717  * def size(self): # <<<<<<<<<<<<<<
13718  * if self._size is None:
13719  * result = 1
13720  */
13721 
13722 /* Python wrapper */
13723 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
13724 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13725  PyObject *__pyx_r = 0;
13726  __Pyx_RefNannyDeclarations
13727  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13728  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13729 
13730  /* function exit code */
13731  __Pyx_RefNannyFinishContext();
13732  return __pyx_r;
13733 }
13734 
13735 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13736  PyObject *__pyx_v_result = NULL;
13737  PyObject *__pyx_v_length = NULL;
13738  PyObject *__pyx_r = NULL;
13739  __Pyx_RefNannyDeclarations
13740  int __pyx_t_1;
13741  int __pyx_t_2;
13742  Py_ssize_t *__pyx_t_3;
13743  Py_ssize_t *__pyx_t_4;
13744  Py_ssize_t *__pyx_t_5;
13745  PyObject *__pyx_t_6 = NULL;
13746  __Pyx_RefNannySetupContext("__get__", 0);
13747 
13748  /* "View.MemoryView":590
13749  * @property
13750  * def size(self):
13751  * if self._size is None: # <<<<<<<<<<<<<<
13752  * result = 1
13753  *
13754  */
13755  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13756  __pyx_t_2 = (__pyx_t_1 != 0);
13757  if (__pyx_t_2) {
13758 
13759  /* "View.MemoryView":591
13760  * def size(self):
13761  * if self._size is None:
13762  * result = 1 # <<<<<<<<<<<<<<
13763  *
13764  * for length in self.view.shape[:self.view.ndim]:
13765  */
13766  __Pyx_INCREF(__pyx_int_1);
13767  __pyx_v_result = __pyx_int_1;
13768 
13769  /* "View.MemoryView":593
13770  * result = 1
13771  *
13772  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
13773  * result *= length
13774  *
13775  */
13776  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13777  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13778  __pyx_t_3 = __pyx_t_5;
13779  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 593, __pyx_L1_error)
13780  __Pyx_GOTREF(__pyx_t_6);
13781  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13782  __pyx_t_6 = 0;
13783 
13784  /* "View.MemoryView":594
13785  *
13786  * for length in self.view.shape[:self.view.ndim]:
13787  * result *= length # <<<<<<<<<<<<<<
13788  *
13789  * self._size = result
13790  */
13791  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 594, __pyx_L1_error)
13792  __Pyx_GOTREF(__pyx_t_6);
13793  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13794  __pyx_t_6 = 0;
13795  }
13796 
13797  /* "View.MemoryView":596
13798  * result *= length
13799  *
13800  * self._size = result # <<<<<<<<<<<<<<
13801  *
13802  * return self._size
13803  */
13804  __Pyx_INCREF(__pyx_v_result);
13805  __Pyx_GIVEREF(__pyx_v_result);
13806  __Pyx_GOTREF(__pyx_v_self->_size);
13807  __Pyx_DECREF(__pyx_v_self->_size);
13808  __pyx_v_self->_size = __pyx_v_result;
13809 
13810  /* "View.MemoryView":590
13811  * @property
13812  * def size(self):
13813  * if self._size is None: # <<<<<<<<<<<<<<
13814  * result = 1
13815  *
13816  */
13817  }
13818 
13819  /* "View.MemoryView":598
13820  * self._size = result
13821  *
13822  * return self._size # <<<<<<<<<<<<<<
13823  *
13824  * def __len__(self):
13825  */
13826  __Pyx_XDECREF(__pyx_r);
13827  __Pyx_INCREF(__pyx_v_self->_size);
13828  __pyx_r = __pyx_v_self->_size;
13829  goto __pyx_L0;
13830 
13831  /* "View.MemoryView":589
13832  *
13833  * @property
13834  * def size(self): # <<<<<<<<<<<<<<
13835  * if self._size is None:
13836  * result = 1
13837  */
13838 
13839  /* function exit code */
13840  __pyx_L1_error:;
13841  __Pyx_XDECREF(__pyx_t_6);
13842  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13843  __pyx_r = NULL;
13844  __pyx_L0:;
13845  __Pyx_XDECREF(__pyx_v_result);
13846  __Pyx_XDECREF(__pyx_v_length);
13847  __Pyx_XGIVEREF(__pyx_r);
13848  __Pyx_RefNannyFinishContext();
13849  return __pyx_r;
13850 }
13851 
13852 /* "View.MemoryView":600
13853  * return self._size
13854  *
13855  * def __len__(self): # <<<<<<<<<<<<<<
13856  * if self.view.ndim >= 1:
13857  * return self.view.shape[0]
13858  */
13859 
13860 /* Python wrapper */
13861 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
13862 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13863  Py_ssize_t __pyx_r;
13864  __Pyx_RefNannyDeclarations
13865  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
13866  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13867 
13868  /* function exit code */
13869  __Pyx_RefNannyFinishContext();
13870  return __pyx_r;
13871 }
13872 
13873 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
13874  Py_ssize_t __pyx_r;
13875  __Pyx_RefNannyDeclarations
13876  int __pyx_t_1;
13877  __Pyx_RefNannySetupContext("__len__", 0);
13878 
13879  /* "View.MemoryView":601
13880  *
13881  * def __len__(self):
13882  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13883  * return self.view.shape[0]
13884  *
13885  */
13886  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13887  if (__pyx_t_1) {
13888 
13889  /* "View.MemoryView":602
13890  * def __len__(self):
13891  * if self.view.ndim >= 1:
13892  * return self.view.shape[0] # <<<<<<<<<<<<<<
13893  *
13894  * return 0
13895  */
13896  __pyx_r = (__pyx_v_self->view.shape[0]);
13897  goto __pyx_L0;
13898 
13899  /* "View.MemoryView":601
13900  *
13901  * def __len__(self):
13902  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13903  * return self.view.shape[0]
13904  *
13905  */
13906  }
13907 
13908  /* "View.MemoryView":604
13909  * return self.view.shape[0]
13910  *
13911  * return 0 # <<<<<<<<<<<<<<
13912  *
13913  * def __repr__(self):
13914  */
13915  __pyx_r = 0;
13916  goto __pyx_L0;
13917 
13918  /* "View.MemoryView":600
13919  * return self._size
13920  *
13921  * def __len__(self): # <<<<<<<<<<<<<<
13922  * if self.view.ndim >= 1:
13923  * return self.view.shape[0]
13924  */
13925 
13926  /* function exit code */
13927  __pyx_L0:;
13928  __Pyx_RefNannyFinishContext();
13929  return __pyx_r;
13930 }
13931 
13932 /* "View.MemoryView":606
13933  * return 0
13934  *
13935  * def __repr__(self): # <<<<<<<<<<<<<<
13936  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13937  * id(self))
13938  */
13939 
13940 /* Python wrapper */
13941 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
13942 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13943  PyObject *__pyx_r = 0;
13944  __Pyx_RefNannyDeclarations
13945  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13946  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13947 
13948  /* function exit code */
13949  __Pyx_RefNannyFinishContext();
13950  return __pyx_r;
13951 }
13952 
13953 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
13954  PyObject *__pyx_r = NULL;
13955  __Pyx_RefNannyDeclarations
13956  PyObject *__pyx_t_1 = NULL;
13957  PyObject *__pyx_t_2 = NULL;
13958  PyObject *__pyx_t_3 = NULL;
13959  __Pyx_RefNannySetupContext("__repr__", 0);
13960 
13961  /* "View.MemoryView":607
13962  *
13963  * def __repr__(self):
13964  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13965  * id(self))
13966  *
13967  */
13968  __Pyx_XDECREF(__pyx_r);
13969  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 607, __pyx_L1_error)
13970  __Pyx_GOTREF(__pyx_t_1);
13971  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __pyx_L1_error)
13972  __Pyx_GOTREF(__pyx_t_2);
13973  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13974  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 607, __pyx_L1_error)
13975  __Pyx_GOTREF(__pyx_t_1);
13976  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13977 
13978  /* "View.MemoryView":608
13979  * def __repr__(self):
13980  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13981  * id(self)) # <<<<<<<<<<<<<<
13982  *
13983  * def __str__(self):
13984  */
13985  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
13986  __Pyx_GOTREF(__pyx_t_2);
13987 
13988  /* "View.MemoryView":607
13989  *
13990  * def __repr__(self):
13991  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13992  * id(self))
13993  *
13994  */
13995  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 607, __pyx_L1_error)
13996  __Pyx_GOTREF(__pyx_t_3);
13997  __Pyx_GIVEREF(__pyx_t_1);
13998  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13999  __Pyx_GIVEREF(__pyx_t_2);
14000  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14001  __pyx_t_1 = 0;
14002  __pyx_t_2 = 0;
14003  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __pyx_L1_error)
14004  __Pyx_GOTREF(__pyx_t_2);
14005  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14006  __pyx_r = __pyx_t_2;
14007  __pyx_t_2 = 0;
14008  goto __pyx_L0;
14009 
14010  /* "View.MemoryView":606
14011  * return 0
14012  *
14013  * def __repr__(self): # <<<<<<<<<<<<<<
14014  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14015  * id(self))
14016  */
14017 
14018  /* function exit code */
14019  __pyx_L1_error:;
14020  __Pyx_XDECREF(__pyx_t_1);
14021  __Pyx_XDECREF(__pyx_t_2);
14022  __Pyx_XDECREF(__pyx_t_3);
14023  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14024  __pyx_r = NULL;
14025  __pyx_L0:;
14026  __Pyx_XGIVEREF(__pyx_r);
14027  __Pyx_RefNannyFinishContext();
14028  return __pyx_r;
14029 }
14030 
14031 /* "View.MemoryView":610
14032  * id(self))
14033  *
14034  * def __str__(self): # <<<<<<<<<<<<<<
14035  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14036  *
14037  */
14038 
14039 /* Python wrapper */
14040 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
14041 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14042  PyObject *__pyx_r = 0;
14043  __Pyx_RefNannyDeclarations
14044  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
14045  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14046 
14047  /* function exit code */
14048  __Pyx_RefNannyFinishContext();
14049  return __pyx_r;
14050 }
14051 
14052 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
14053  PyObject *__pyx_r = NULL;
14054  __Pyx_RefNannyDeclarations
14055  PyObject *__pyx_t_1 = NULL;
14056  PyObject *__pyx_t_2 = NULL;
14057  __Pyx_RefNannySetupContext("__str__", 0);
14058 
14059  /* "View.MemoryView":611
14060  *
14061  * def __str__(self):
14062  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
14063  *
14064  *
14065  */
14066  __Pyx_XDECREF(__pyx_r);
14067  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
14068  __Pyx_GOTREF(__pyx_t_1);
14069  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 611, __pyx_L1_error)
14070  __Pyx_GOTREF(__pyx_t_2);
14071  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14072  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
14073  __Pyx_GOTREF(__pyx_t_1);
14074  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14075  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 611, __pyx_L1_error)
14076  __Pyx_GOTREF(__pyx_t_2);
14077  __Pyx_GIVEREF(__pyx_t_1);
14078  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14079  __pyx_t_1 = 0;
14080  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
14081  __Pyx_GOTREF(__pyx_t_1);
14082  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14083  __pyx_r = __pyx_t_1;
14084  __pyx_t_1 = 0;
14085  goto __pyx_L0;
14086 
14087  /* "View.MemoryView":610
14088  * id(self))
14089  *
14090  * def __str__(self): # <<<<<<<<<<<<<<
14091  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14092  *
14093  */
14094 
14095  /* function exit code */
14096  __pyx_L1_error:;
14097  __Pyx_XDECREF(__pyx_t_1);
14098  __Pyx_XDECREF(__pyx_t_2);
14099  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14100  __pyx_r = NULL;
14101  __pyx_L0:;
14102  __Pyx_XGIVEREF(__pyx_r);
14103  __Pyx_RefNannyFinishContext();
14104  return __pyx_r;
14105 }
14106 
14107 /* "View.MemoryView":614
14108  *
14109  *
14110  * def is_c_contig(self): # <<<<<<<<<<<<<<
14111  * cdef __Pyx_memviewslice *mslice
14112  * cdef __Pyx_memviewslice tmp
14113  */
14114 
14115 /* Python wrapper */
14116 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14117 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
14118 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14119  PyObject *__pyx_r = 0;
14120  __Pyx_RefNannyDeclarations
14121  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
14122  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14123 
14124  /* function exit code */
14125  __Pyx_RefNannyFinishContext();
14126  return __pyx_r;
14127 }
14128 
14129 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14130  __Pyx_memviewslice *__pyx_v_mslice;
14131  __Pyx_memviewslice __pyx_v_tmp;
14132  PyObject *__pyx_r = NULL;
14133  __Pyx_RefNannyDeclarations
14134  PyObject *__pyx_t_1 = NULL;
14135  __Pyx_RefNannySetupContext("is_c_contig", 0);
14136 
14137  /* "View.MemoryView":617
14138  * cdef __Pyx_memviewslice *mslice
14139  * cdef __Pyx_memviewslice tmp
14140  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14141  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14142  *
14143  */
14144  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
14145 
14146  /* "View.MemoryView":618
14147  * cdef __Pyx_memviewslice tmp
14148  * mslice = get_slice_from_memview(self, &tmp)
14149  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
14150  *
14151  * def is_f_contig(self):
14152  */
14153  __Pyx_XDECREF(__pyx_r);
14154  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
14155  __Pyx_GOTREF(__pyx_t_1);
14156  __pyx_r = __pyx_t_1;
14157  __pyx_t_1 = 0;
14158  goto __pyx_L0;
14159 
14160  /* "View.MemoryView":614
14161  *
14162  *
14163  * def is_c_contig(self): # <<<<<<<<<<<<<<
14164  * cdef __Pyx_memviewslice *mslice
14165  * cdef __Pyx_memviewslice tmp
14166  */
14167 
14168  /* function exit code */
14169  __pyx_L1_error:;
14170  __Pyx_XDECREF(__pyx_t_1);
14171  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14172  __pyx_r = NULL;
14173  __pyx_L0:;
14174  __Pyx_XGIVEREF(__pyx_r);
14175  __Pyx_RefNannyFinishContext();
14176  return __pyx_r;
14177 }
14178 
14179 /* "View.MemoryView":620
14180  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14181  *
14182  * def is_f_contig(self): # <<<<<<<<<<<<<<
14183  * cdef __Pyx_memviewslice *mslice
14184  * cdef __Pyx_memviewslice tmp
14185  */
14186 
14187 /* Python wrapper */
14188 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14189 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
14190 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14191  PyObject *__pyx_r = 0;
14192  __Pyx_RefNannyDeclarations
14193  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
14194  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14195 
14196  /* function exit code */
14197  __Pyx_RefNannyFinishContext();
14198  return __pyx_r;
14199 }
14200 
14201 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14202  __Pyx_memviewslice *__pyx_v_mslice;
14203  __Pyx_memviewslice __pyx_v_tmp;
14204  PyObject *__pyx_r = NULL;
14205  __Pyx_RefNannyDeclarations
14206  PyObject *__pyx_t_1 = NULL;
14207  __Pyx_RefNannySetupContext("is_f_contig", 0);
14208 
14209  /* "View.MemoryView":623
14210  * cdef __Pyx_memviewslice *mslice
14211  * cdef __Pyx_memviewslice tmp
14212  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14213  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14214  *
14215  */
14216  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
14217 
14218  /* "View.MemoryView":624
14219  * cdef __Pyx_memviewslice tmp
14220  * mslice = get_slice_from_memview(self, &tmp)
14221  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
14222  *
14223  * def copy(self):
14224  */
14225  __Pyx_XDECREF(__pyx_r);
14226  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 624, __pyx_L1_error)
14227  __Pyx_GOTREF(__pyx_t_1);
14228  __pyx_r = __pyx_t_1;
14229  __pyx_t_1 = 0;
14230  goto __pyx_L0;
14231 
14232  /* "View.MemoryView":620
14233  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14234  *
14235  * def is_f_contig(self): # <<<<<<<<<<<<<<
14236  * cdef __Pyx_memviewslice *mslice
14237  * cdef __Pyx_memviewslice tmp
14238  */
14239 
14240  /* function exit code */
14241  __pyx_L1_error:;
14242  __Pyx_XDECREF(__pyx_t_1);
14243  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14244  __pyx_r = NULL;
14245  __pyx_L0:;
14246  __Pyx_XGIVEREF(__pyx_r);
14247  __Pyx_RefNannyFinishContext();
14248  return __pyx_r;
14249 }
14250 
14251 /* "View.MemoryView":626
14252  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14253  *
14254  * def copy(self): # <<<<<<<<<<<<<<
14255  * cdef __Pyx_memviewslice mslice
14256  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14257  */
14258 
14259 /* Python wrapper */
14260 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14261 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
14262 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14263  PyObject *__pyx_r = 0;
14264  __Pyx_RefNannyDeclarations
14265  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
14266  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
14267 
14268  /* function exit code */
14269  __Pyx_RefNannyFinishContext();
14270  return __pyx_r;
14271 }
14272 
14273 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
14274  __Pyx_memviewslice __pyx_v_mslice;
14275  int __pyx_v_flags;
14276  PyObject *__pyx_r = NULL;
14277  __Pyx_RefNannyDeclarations
14278  __Pyx_memviewslice __pyx_t_1;
14279  PyObject *__pyx_t_2 = NULL;
14280  __Pyx_RefNannySetupContext("copy", 0);
14281 
14282  /* "View.MemoryView":628
14283  * def copy(self):
14284  * cdef __Pyx_memviewslice mslice
14285  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
14286  *
14287  * slice_copy(self, &mslice)
14288  */
14289  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14290 
14291  /* "View.MemoryView":630
14292  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14293  *
14294  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
14295  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
14296  * self.view.itemsize,
14297  */
14298  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14299 
14300  /* "View.MemoryView":631
14301  *
14302  * slice_copy(self, &mslice)
14303  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
14304  * self.view.itemsize,
14305  * flags|PyBUF_C_CONTIGUOUS,
14306  */
14307  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 631, __pyx_L1_error)
14308  __pyx_v_mslice = __pyx_t_1;
14309 
14310  /* "View.MemoryView":636
14311  * self.dtype_is_object)
14312  *
14313  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
14314  *
14315  * def copy_fortran(self):
14316  */
14317  __Pyx_XDECREF(__pyx_r);
14318  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 636, __pyx_L1_error)
14319  __Pyx_GOTREF(__pyx_t_2);
14320  __pyx_r = __pyx_t_2;
14321  __pyx_t_2 = 0;
14322  goto __pyx_L0;
14323 
14324  /* "View.MemoryView":626
14325  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14326  *
14327  * def copy(self): # <<<<<<<<<<<<<<
14328  * cdef __Pyx_memviewslice mslice
14329  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14330  */
14331 
14332  /* function exit code */
14333  __pyx_L1_error:;
14334  __Pyx_XDECREF(__pyx_t_2);
14335  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14336  __pyx_r = NULL;
14337  __pyx_L0:;
14338  __Pyx_XGIVEREF(__pyx_r);
14339  __Pyx_RefNannyFinishContext();
14340  return __pyx_r;
14341 }
14342 
14343 /* "View.MemoryView":638
14344  * return memoryview_copy_from_slice(self, &mslice)
14345  *
14346  * def copy_fortran(self): # <<<<<<<<<<<<<<
14347  * cdef __Pyx_memviewslice src, dst
14348  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14349  */
14350 
14351 /* Python wrapper */
14352 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14353 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
14354 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14355  PyObject *__pyx_r = 0;
14356  __Pyx_RefNannyDeclarations
14357  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
14358  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
14359 
14360  /* function exit code */
14361  __Pyx_RefNannyFinishContext();
14362  return __pyx_r;
14363 }
14364 
14365 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
14366  __Pyx_memviewslice __pyx_v_src;
14367  __Pyx_memviewslice __pyx_v_dst;
14368  int __pyx_v_flags;
14369  PyObject *__pyx_r = NULL;
14370  __Pyx_RefNannyDeclarations
14371  __Pyx_memviewslice __pyx_t_1;
14372  PyObject *__pyx_t_2 = NULL;
14373  __Pyx_RefNannySetupContext("copy_fortran", 0);
14374 
14375  /* "View.MemoryView":640
14376  * def copy_fortran(self):
14377  * cdef __Pyx_memviewslice src, dst
14378  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
14379  *
14380  * slice_copy(self, &src)
14381  */
14382  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14383 
14384  /* "View.MemoryView":642
14385  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14386  *
14387  * slice_copy(self, &src) # <<<<<<<<<<<<<<
14388  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
14389  * self.view.itemsize,
14390  */
14391  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14392 
14393  /* "View.MemoryView":643
14394  *
14395  * slice_copy(self, &src)
14396  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
14397  * self.view.itemsize,
14398  * flags|PyBUF_F_CONTIGUOUS,
14399  */
14400  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 643, __pyx_L1_error)
14401  __pyx_v_dst = __pyx_t_1;
14402 
14403  /* "View.MemoryView":648
14404  * self.dtype_is_object)
14405  *
14406  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
14407  *
14408  *
14409  */
14410  __Pyx_XDECREF(__pyx_r);
14411  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 648, __pyx_L1_error)
14412  __Pyx_GOTREF(__pyx_t_2);
14413  __pyx_r = __pyx_t_2;
14414  __pyx_t_2 = 0;
14415  goto __pyx_L0;
14416 
14417  /* "View.MemoryView":638
14418  * return memoryview_copy_from_slice(self, &mslice)
14419  *
14420  * def copy_fortran(self): # <<<<<<<<<<<<<<
14421  * cdef __Pyx_memviewslice src, dst
14422  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14423  */
14424 
14425  /* function exit code */
14426  __pyx_L1_error:;
14427  __Pyx_XDECREF(__pyx_t_2);
14428  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14429  __pyx_r = NULL;
14430  __pyx_L0:;
14431  __Pyx_XGIVEREF(__pyx_r);
14432  __Pyx_RefNannyFinishContext();
14433  return __pyx_r;
14434 }
14435 
14436 /* "(tree fragment)":1
14437  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14438  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14439  * def __setstate_cython__(self, __pyx_state):
14440  */
14441 
14442 /* Python wrapper */
14443 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14444 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
14445 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14446  PyObject *__pyx_r = 0;
14447  __Pyx_RefNannyDeclarations
14448  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14449  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14450 
14451  /* function exit code */
14452  __Pyx_RefNannyFinishContext();
14453  return __pyx_r;
14454 }
14455 
14456 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
14457  PyObject *__pyx_r = NULL;
14458  __Pyx_RefNannyDeclarations
14459  PyObject *__pyx_t_1 = NULL;
14460  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14461 
14462  /* "(tree fragment)":2
14463  * def __reduce_cython__(self):
14464  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14465  * def __setstate_cython__(self, __pyx_state):
14466  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14467  */
14468  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14469  __Pyx_GOTREF(__pyx_t_1);
14470  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14471  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14472  __PYX_ERR(1, 2, __pyx_L1_error)
14473 
14474  /* "(tree fragment)":1
14475  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14476  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14477  * def __setstate_cython__(self, __pyx_state):
14478  */
14479 
14480  /* function exit code */
14481  __pyx_L1_error:;
14482  __Pyx_XDECREF(__pyx_t_1);
14483  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14484  __pyx_r = NULL;
14485  __Pyx_XGIVEREF(__pyx_r);
14486  __Pyx_RefNannyFinishContext();
14487  return __pyx_r;
14488 }
14489 
14490 /* "(tree fragment)":3
14491  * def __reduce_cython__(self):
14492  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14493  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14494  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14495  */
14496 
14497 /* Python wrapper */
14498 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14499 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
14500 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14501  PyObject *__pyx_r = 0;
14502  __Pyx_RefNannyDeclarations
14503  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14504  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14505 
14506  /* function exit code */
14507  __Pyx_RefNannyFinishContext();
14508  return __pyx_r;
14509 }
14510 
14511 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14512  PyObject *__pyx_r = NULL;
14513  __Pyx_RefNannyDeclarations
14514  PyObject *__pyx_t_1 = NULL;
14515  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14516 
14517  /* "(tree fragment)":4
14518  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14519  * def __setstate_cython__(self, __pyx_state):
14520  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14521  */
14522  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14523  __Pyx_GOTREF(__pyx_t_1);
14524  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14525  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14526  __PYX_ERR(1, 4, __pyx_L1_error)
14527 
14528  /* "(tree fragment)":3
14529  * def __reduce_cython__(self):
14530  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14531  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14532  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14533  */
14534 
14535  /* function exit code */
14536  __pyx_L1_error:;
14537  __Pyx_XDECREF(__pyx_t_1);
14538  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14539  __pyx_r = NULL;
14540  __Pyx_XGIVEREF(__pyx_r);
14541  __Pyx_RefNannyFinishContext();
14542  return __pyx_r;
14543 }
14544 
14545 /* "View.MemoryView":652
14546  *
14547  * @cname('__pyx_memoryview_new')
14548  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14549  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14550  * result.typeinfo = typeinfo
14551  */
14552 
14553 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14554  struct __pyx_memoryview_obj *__pyx_v_result = 0;
14555  PyObject *__pyx_r = NULL;
14556  __Pyx_RefNannyDeclarations
14557  PyObject *__pyx_t_1 = NULL;
14558  PyObject *__pyx_t_2 = NULL;
14559  PyObject *__pyx_t_3 = NULL;
14560  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14561 
14562  /* "View.MemoryView":653
14563  * @cname('__pyx_memoryview_new')
14564  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14565  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
14566  * result.typeinfo = typeinfo
14567  * return result
14568  */
14569  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 653, __pyx_L1_error)
14570  __Pyx_GOTREF(__pyx_t_1);
14571  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14572  __Pyx_GOTREF(__pyx_t_2);
14573  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 653, __pyx_L1_error)
14574  __Pyx_GOTREF(__pyx_t_3);
14575  __Pyx_INCREF(__pyx_v_o);
14576  __Pyx_GIVEREF(__pyx_v_o);
14577  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14578  __Pyx_GIVEREF(__pyx_t_1);
14579  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14580  __Pyx_GIVEREF(__pyx_t_2);
14581  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14582  __pyx_t_1 = 0;
14583  __pyx_t_2 = 0;
14584  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14585  __Pyx_GOTREF(__pyx_t_2);
14586  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14587  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14588  __pyx_t_2 = 0;
14589 
14590  /* "View.MemoryView":654
14591  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14592  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14593  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
14594  * return result
14595  *
14596  */
14597  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14598 
14599  /* "View.MemoryView":655
14600  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14601  * result.typeinfo = typeinfo
14602  * return result # <<<<<<<<<<<<<<
14603  *
14604  * @cname('__pyx_memoryview_check')
14605  */
14606  __Pyx_XDECREF(__pyx_r);
14607  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14608  __pyx_r = ((PyObject *)__pyx_v_result);
14609  goto __pyx_L0;
14610 
14611  /* "View.MemoryView":652
14612  *
14613  * @cname('__pyx_memoryview_new')
14614  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14615  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14616  * result.typeinfo = typeinfo
14617  */
14618 
14619  /* function exit code */
14620  __pyx_L1_error:;
14621  __Pyx_XDECREF(__pyx_t_1);
14622  __Pyx_XDECREF(__pyx_t_2);
14623  __Pyx_XDECREF(__pyx_t_3);
14624  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14625  __pyx_r = 0;
14626  __pyx_L0:;
14627  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14628  __Pyx_XGIVEREF(__pyx_r);
14629  __Pyx_RefNannyFinishContext();
14630  return __pyx_r;
14631 }
14632 
14633 /* "View.MemoryView":658
14634  *
14635  * @cname('__pyx_memoryview_check')
14636  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14637  * return isinstance(o, memoryview)
14638  *
14639  */
14640 
14641 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14642  int __pyx_r;
14643  __Pyx_RefNannyDeclarations
14644  int __pyx_t_1;
14645  __Pyx_RefNannySetupContext("memoryview_check", 0);
14646 
14647  /* "View.MemoryView":659
14648  * @cname('__pyx_memoryview_check')
14649  * cdef inline bint memoryview_check(object o):
14650  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
14651  *
14652  * cdef tuple _unellipsify(object index, int ndim):
14653  */
14654  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14655  __pyx_r = __pyx_t_1;
14656  goto __pyx_L0;
14657 
14658  /* "View.MemoryView":658
14659  *
14660  * @cname('__pyx_memoryview_check')
14661  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14662  * return isinstance(o, memoryview)
14663  *
14664  */
14665 
14666  /* function exit code */
14667  __pyx_L0:;
14668  __Pyx_RefNannyFinishContext();
14669  return __pyx_r;
14670 }
14671 
14672 /* "View.MemoryView":661
14673  * return isinstance(o, memoryview)
14674  *
14675  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14676  * """
14677  * Replace all ellipses with full slices and fill incomplete indices with
14678  */
14679 
14680 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
14681  PyObject *__pyx_v_tup = NULL;
14682  PyObject *__pyx_v_result = NULL;
14683  int __pyx_v_have_slices;
14684  int __pyx_v_seen_ellipsis;
14685  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14686  PyObject *__pyx_v_item = NULL;
14687  Py_ssize_t __pyx_v_nslices;
14688  PyObject *__pyx_r = NULL;
14689  __Pyx_RefNannyDeclarations
14690  int __pyx_t_1;
14691  int __pyx_t_2;
14692  PyObject *__pyx_t_3 = NULL;
14693  PyObject *__pyx_t_4 = NULL;
14694  Py_ssize_t __pyx_t_5;
14695  PyObject *(*__pyx_t_6)(PyObject *);
14696  PyObject *__pyx_t_7 = NULL;
14697  Py_ssize_t __pyx_t_8;
14698  int __pyx_t_9;
14699  int __pyx_t_10;
14700  PyObject *__pyx_t_11 = NULL;
14701  __Pyx_RefNannySetupContext("_unellipsify", 0);
14702 
14703  /* "View.MemoryView":666
14704  * full slices.
14705  * """
14706  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14707  * tup = (index,)
14708  * else:
14709  */
14710  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14711  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14712  if (__pyx_t_2) {
14713 
14714  /* "View.MemoryView":667
14715  * """
14716  * if not isinstance(index, tuple):
14717  * tup = (index,) # <<<<<<<<<<<<<<
14718  * else:
14719  * tup = index
14720  */
14721  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 667, __pyx_L1_error)
14722  __Pyx_GOTREF(__pyx_t_3);
14723  __Pyx_INCREF(__pyx_v_index);
14724  __Pyx_GIVEREF(__pyx_v_index);
14725  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14726  __pyx_v_tup = __pyx_t_3;
14727  __pyx_t_3 = 0;
14728 
14729  /* "View.MemoryView":666
14730  * full slices.
14731  * """
14732  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14733  * tup = (index,)
14734  * else:
14735  */
14736  goto __pyx_L3;
14737  }
14738 
14739  /* "View.MemoryView":669
14740  * tup = (index,)
14741  * else:
14742  * tup = index # <<<<<<<<<<<<<<
14743  *
14744  * result = []
14745  */
14746  /*else*/ {
14747  __Pyx_INCREF(__pyx_v_index);
14748  __pyx_v_tup = __pyx_v_index;
14749  }
14750  __pyx_L3:;
14751 
14752  /* "View.MemoryView":671
14753  * tup = index
14754  *
14755  * result = [] # <<<<<<<<<<<<<<
14756  * have_slices = False
14757  * seen_ellipsis = False
14758  */
14759  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 671, __pyx_L1_error)
14760  __Pyx_GOTREF(__pyx_t_3);
14761  __pyx_v_result = ((PyObject*)__pyx_t_3);
14762  __pyx_t_3 = 0;
14763 
14764  /* "View.MemoryView":672
14765  *
14766  * result = []
14767  * have_slices = False # <<<<<<<<<<<<<<
14768  * seen_ellipsis = False
14769  * for idx, item in enumerate(tup):
14770  */
14771  __pyx_v_have_slices = 0;
14772 
14773  /* "View.MemoryView":673
14774  * result = []
14775  * have_slices = False
14776  * seen_ellipsis = False # <<<<<<<<<<<<<<
14777  * for idx, item in enumerate(tup):
14778  * if item is Ellipsis:
14779  */
14780  __pyx_v_seen_ellipsis = 0;
14781 
14782  /* "View.MemoryView":674
14783  * have_slices = False
14784  * seen_ellipsis = False
14785  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14786  * if item is Ellipsis:
14787  * if not seen_ellipsis:
14788  */
14789  __Pyx_INCREF(__pyx_int_0);
14790  __pyx_t_3 = __pyx_int_0;
14791  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14792  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14793  __pyx_t_6 = NULL;
14794  } else {
14795  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 674, __pyx_L1_error)
14796  __Pyx_GOTREF(__pyx_t_4);
14797  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 674, __pyx_L1_error)
14798  }
14799  for (;;) {
14800  if (likely(!__pyx_t_6)) {
14801  if (likely(PyList_CheckExact(__pyx_t_4))) {
14802  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
14803  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14804  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 674, __pyx_L1_error)
14805  #else
14806  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
14807  __Pyx_GOTREF(__pyx_t_7);
14808  #endif
14809  } else {
14810  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
14811  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14812  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 674, __pyx_L1_error)
14813  #else
14814  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
14815  __Pyx_GOTREF(__pyx_t_7);
14816  #endif
14817  }
14818  } else {
14819  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14820  if (unlikely(!__pyx_t_7)) {
14821  PyObject* exc_type = PyErr_Occurred();
14822  if (exc_type) {
14823  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14824  else __PYX_ERR(1, 674, __pyx_L1_error)
14825  }
14826  break;
14827  }
14828  __Pyx_GOTREF(__pyx_t_7);
14829  }
14830  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14831  __pyx_t_7 = 0;
14832  __Pyx_INCREF(__pyx_t_3);
14833  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14834  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
14835  __Pyx_GOTREF(__pyx_t_7);
14836  __Pyx_DECREF(__pyx_t_3);
14837  __pyx_t_3 = __pyx_t_7;
14838  __pyx_t_7 = 0;
14839 
14840  /* "View.MemoryView":675
14841  * seen_ellipsis = False
14842  * for idx, item in enumerate(tup):
14843  * if item is Ellipsis: # <<<<<<<<<<<<<<
14844  * if not seen_ellipsis:
14845  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14846  */
14847  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14848  __pyx_t_1 = (__pyx_t_2 != 0);
14849  if (__pyx_t_1) {
14850 
14851  /* "View.MemoryView":676
14852  * for idx, item in enumerate(tup):
14853  * if item is Ellipsis:
14854  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14855  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14856  * seen_ellipsis = True
14857  */
14858  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14859  if (__pyx_t_1) {
14860 
14861  /* "View.MemoryView":677
14862  * if item is Ellipsis:
14863  * if not seen_ellipsis:
14864  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
14865  * seen_ellipsis = True
14866  * else:
14867  */
14868  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 677, __pyx_L1_error)
14869  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 677, __pyx_L1_error)
14870  __Pyx_GOTREF(__pyx_t_7);
14871  { Py_ssize_t __pyx_temp;
14872  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14873  __Pyx_INCREF(__pyx_slice__29);
14874  __Pyx_GIVEREF(__pyx_slice__29);
14875  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__29);
14876  }
14877  }
14878  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 677, __pyx_L1_error)
14879  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14880 
14881  /* "View.MemoryView":678
14882  * if not seen_ellipsis:
14883  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14884  * seen_ellipsis = True # <<<<<<<<<<<<<<
14885  * else:
14886  * result.append(slice(None))
14887  */
14888  __pyx_v_seen_ellipsis = 1;
14889 
14890  /* "View.MemoryView":676
14891  * for idx, item in enumerate(tup):
14892  * if item is Ellipsis:
14893  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14894  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14895  * seen_ellipsis = True
14896  */
14897  goto __pyx_L7;
14898  }
14899 
14900  /* "View.MemoryView":680
14901  * seen_ellipsis = True
14902  * else:
14903  * result.append(slice(None)) # <<<<<<<<<<<<<<
14904  * have_slices = True
14905  * else:
14906  */
14907  /*else*/ {
14908  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__30); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 680, __pyx_L1_error)
14909  }
14910  __pyx_L7:;
14911 
14912  /* "View.MemoryView":681
14913  * else:
14914  * result.append(slice(None))
14915  * have_slices = True # <<<<<<<<<<<<<<
14916  * else:
14917  * if not isinstance(item, slice) and not PyIndex_Check(item):
14918  */
14919  __pyx_v_have_slices = 1;
14920 
14921  /* "View.MemoryView":675
14922  * seen_ellipsis = False
14923  * for idx, item in enumerate(tup):
14924  * if item is Ellipsis: # <<<<<<<<<<<<<<
14925  * if not seen_ellipsis:
14926  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14927  */
14928  goto __pyx_L6;
14929  }
14930 
14931  /* "View.MemoryView":683
14932  * have_slices = True
14933  * else:
14934  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14935  * raise TypeError("Cannot index with type '%s'" % type(item))
14936  *
14937  */
14938  /*else*/ {
14939  __pyx_t_2 = PySlice_Check(__pyx_v_item);
14940  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14941  if (__pyx_t_10) {
14942  } else {
14943  __pyx_t_1 = __pyx_t_10;
14944  goto __pyx_L9_bool_binop_done;
14945  }
14946  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14947  __pyx_t_1 = __pyx_t_10;
14948  __pyx_L9_bool_binop_done:;
14949  if (unlikely(__pyx_t_1)) {
14950 
14951  /* "View.MemoryView":684
14952  * else:
14953  * if not isinstance(item, slice) and not PyIndex_Check(item):
14954  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
14955  *
14956  * have_slices = have_slices or isinstance(item, slice)
14957  */
14958  __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
14959  __Pyx_GOTREF(__pyx_t_7);
14960  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 684, __pyx_L1_error)
14961  __Pyx_GOTREF(__pyx_t_11);
14962  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14963  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14964  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14965  __PYX_ERR(1, 684, __pyx_L1_error)
14966 
14967  /* "View.MemoryView":683
14968  * have_slices = True
14969  * else:
14970  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14971  * raise TypeError("Cannot index with type '%s'" % type(item))
14972  *
14973  */
14974  }
14975 
14976  /* "View.MemoryView":686
14977  * raise TypeError("Cannot index with type '%s'" % type(item))
14978  *
14979  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
14980  * result.append(item)
14981  *
14982  */
14983  __pyx_t_10 = (__pyx_v_have_slices != 0);
14984  if (!__pyx_t_10) {
14985  } else {
14986  __pyx_t_1 = __pyx_t_10;
14987  goto __pyx_L11_bool_binop_done;
14988  }
14989  __pyx_t_10 = PySlice_Check(__pyx_v_item);
14990  __pyx_t_2 = (__pyx_t_10 != 0);
14991  __pyx_t_1 = __pyx_t_2;
14992  __pyx_L11_bool_binop_done:;
14993  __pyx_v_have_slices = __pyx_t_1;
14994 
14995  /* "View.MemoryView":687
14996  *
14997  * have_slices = have_slices or isinstance(item, slice)
14998  * result.append(item) # <<<<<<<<<<<<<<
14999  *
15000  * nslices = ndim - len(result)
15001  */
15002  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
15003  }
15004  __pyx_L6:;
15005 
15006  /* "View.MemoryView":674
15007  * have_slices = False
15008  * seen_ellipsis = False
15009  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15010  * if item is Ellipsis:
15011  * if not seen_ellipsis:
15012  */
15013  }
15014  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15015  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15016 
15017  /* "View.MemoryView":689
15018  * result.append(item)
15019  *
15020  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
15021  * if nslices:
15022  * result.extend([slice(None)] * nslices)
15023  */
15024  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 689, __pyx_L1_error)
15025  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15026 
15027  /* "View.MemoryView":690
15028  *
15029  * nslices = ndim - len(result)
15030  * if nslices: # <<<<<<<<<<<<<<
15031  * result.extend([slice(None)] * nslices)
15032  *
15033  */
15034  __pyx_t_1 = (__pyx_v_nslices != 0);
15035  if (__pyx_t_1) {
15036 
15037  /* "View.MemoryView":691
15038  * nslices = ndim - len(result)
15039  * if nslices:
15040  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
15041  *
15042  * return have_slices or nslices, tuple(result)
15043  */
15044  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 691, __pyx_L1_error)
15045  __Pyx_GOTREF(__pyx_t_3);
15046  { Py_ssize_t __pyx_temp;
15047  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15048  __Pyx_INCREF(__pyx_slice__31);
15049  __Pyx_GIVEREF(__pyx_slice__31);
15050  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__31);
15051  }
15052  }
15053  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 691, __pyx_L1_error)
15054  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15055 
15056  /* "View.MemoryView":690
15057  *
15058  * nslices = ndim - len(result)
15059  * if nslices: # <<<<<<<<<<<<<<
15060  * result.extend([slice(None)] * nslices)
15061  *
15062  */
15063  }
15064 
15065  /* "View.MemoryView":693
15066  * result.extend([slice(None)] * nslices)
15067  *
15068  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
15069  *
15070  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15071  */
15072  __Pyx_XDECREF(__pyx_r);
15073  if (!__pyx_v_have_slices) {
15074  } else {
15075  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
15076  __Pyx_GOTREF(__pyx_t_4);
15077  __pyx_t_3 = __pyx_t_4;
15078  __pyx_t_4 = 0;
15079  goto __pyx_L14_bool_binop_done;
15080  }
15081  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
15082  __Pyx_GOTREF(__pyx_t_4);
15083  __pyx_t_3 = __pyx_t_4;
15084  __pyx_t_4 = 0;
15085  __pyx_L14_bool_binop_done:;
15086  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
15087  __Pyx_GOTREF(__pyx_t_4);
15088  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 693, __pyx_L1_error)
15089  __Pyx_GOTREF(__pyx_t_11);
15090  __Pyx_GIVEREF(__pyx_t_3);
15091  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15092  __Pyx_GIVEREF(__pyx_t_4);
15093  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15094  __pyx_t_3 = 0;
15095  __pyx_t_4 = 0;
15096  __pyx_r = ((PyObject*)__pyx_t_11);
15097  __pyx_t_11 = 0;
15098  goto __pyx_L0;
15099 
15100  /* "View.MemoryView":661
15101  * return isinstance(o, memoryview)
15102  *
15103  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15104  * """
15105  * Replace all ellipses with full slices and fill incomplete indices with
15106  */
15107 
15108  /* function exit code */
15109  __pyx_L1_error:;
15110  __Pyx_XDECREF(__pyx_t_3);
15111  __Pyx_XDECREF(__pyx_t_4);
15112  __Pyx_XDECREF(__pyx_t_7);
15113  __Pyx_XDECREF(__pyx_t_11);
15114  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15115  __pyx_r = 0;
15116  __pyx_L0:;
15117  __Pyx_XDECREF(__pyx_v_tup);
15118  __Pyx_XDECREF(__pyx_v_result);
15119  __Pyx_XDECREF(__pyx_v_idx);
15120  __Pyx_XDECREF(__pyx_v_item);
15121  __Pyx_XGIVEREF(__pyx_r);
15122  __Pyx_RefNannyFinishContext();
15123  return __pyx_r;
15124 }
15125 
15126 /* "View.MemoryView":695
15127  * return have_slices or nslices, tuple(result)
15128  *
15129  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15130  * for suboffset in suboffsets[:ndim]:
15131  * if suboffset >= 0:
15132  */
15133 
15134 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
15135  Py_ssize_t __pyx_v_suboffset;
15136  PyObject *__pyx_r = NULL;
15137  __Pyx_RefNannyDeclarations
15138  Py_ssize_t *__pyx_t_1;
15139  Py_ssize_t *__pyx_t_2;
15140  Py_ssize_t *__pyx_t_3;
15141  int __pyx_t_4;
15142  PyObject *__pyx_t_5 = NULL;
15143  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
15144 
15145  /* "View.MemoryView":696
15146  *
15147  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15148  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
15149  * if suboffset >= 0:
15150  * raise ValueError("Indirect dimensions not supported")
15151  */
15152  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15153  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15154  __pyx_t_1 = __pyx_t_3;
15155  __pyx_v_suboffset = (__pyx_t_1[0]);
15156 
15157  /* "View.MemoryView":697
15158  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15159  * for suboffset in suboffsets[:ndim]:
15160  * if suboffset >= 0: # <<<<<<<<<<<<<<
15161  * raise ValueError("Indirect dimensions not supported")
15162  *
15163  */
15164  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15165  if (unlikely(__pyx_t_4)) {
15166 
15167  /* "View.MemoryView":698
15168  * for suboffset in suboffsets[:ndim]:
15169  * if suboffset >= 0:
15170  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
15171  *
15172  *
15173  */
15174  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 698, __pyx_L1_error)
15175  __Pyx_GOTREF(__pyx_t_5);
15176  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15177  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15178  __PYX_ERR(1, 698, __pyx_L1_error)
15179 
15180  /* "View.MemoryView":697
15181  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15182  * for suboffset in suboffsets[:ndim]:
15183  * if suboffset >= 0: # <<<<<<<<<<<<<<
15184  * raise ValueError("Indirect dimensions not supported")
15185  *
15186  */
15187  }
15188  }
15189 
15190  /* "View.MemoryView":695
15191  * return have_slices or nslices, tuple(result)
15192  *
15193  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15194  * for suboffset in suboffsets[:ndim]:
15195  * if suboffset >= 0:
15196  */
15197 
15198  /* function exit code */
15199  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15200  goto __pyx_L0;
15201  __pyx_L1_error:;
15202  __Pyx_XDECREF(__pyx_t_5);
15203  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15204  __pyx_r = 0;
15205  __pyx_L0:;
15206  __Pyx_XGIVEREF(__pyx_r);
15207  __Pyx_RefNannyFinishContext();
15208  return __pyx_r;
15209 }
15210 
15211 /* "View.MemoryView":705
15212  *
15213  * @cname('__pyx_memview_slice')
15214  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15215  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15216  * cdef bint negative_step
15217  */
15218 
15219 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15220  int __pyx_v_new_ndim;
15221  int __pyx_v_suboffset_dim;
15222  int __pyx_v_dim;
15223  __Pyx_memviewslice __pyx_v_src;
15224  __Pyx_memviewslice __pyx_v_dst;
15225  __Pyx_memviewslice *__pyx_v_p_src;
15226  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15227  __Pyx_memviewslice *__pyx_v_p_dst;
15228  int *__pyx_v_p_suboffset_dim;
15229  Py_ssize_t __pyx_v_start;
15230  Py_ssize_t __pyx_v_stop;
15231  Py_ssize_t __pyx_v_step;
15232  int __pyx_v_have_start;
15233  int __pyx_v_have_stop;
15234  int __pyx_v_have_step;
15235  PyObject *__pyx_v_index = NULL;
15236  struct __pyx_memoryview_obj *__pyx_r = NULL;
15237  __Pyx_RefNannyDeclarations
15238  int __pyx_t_1;
15239  int __pyx_t_2;
15240  PyObject *__pyx_t_3 = NULL;
15241  struct __pyx_memoryview_obj *__pyx_t_4;
15242  char *__pyx_t_5;
15243  int __pyx_t_6;
15244  Py_ssize_t __pyx_t_7;
15245  PyObject *(*__pyx_t_8)(PyObject *);
15246  PyObject *__pyx_t_9 = NULL;
15247  Py_ssize_t __pyx_t_10;
15248  int __pyx_t_11;
15249  Py_ssize_t __pyx_t_12;
15250  __Pyx_RefNannySetupContext("memview_slice", 0);
15251 
15252  /* "View.MemoryView":706
15253  * @cname('__pyx_memview_slice')
15254  * cdef memoryview memview_slice(memoryview memview, object indices):
15255  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
15256  * cdef bint negative_step
15257  * cdef __Pyx_memviewslice src, dst
15258  */
15259  __pyx_v_new_ndim = 0;
15260  __pyx_v_suboffset_dim = -1;
15261 
15262  /* "View.MemoryView":713
15263  *
15264  *
15265  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
15266  *
15267  * cdef _memoryviewslice memviewsliceobj
15268  */
15269  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
15270 
15271  /* "View.MemoryView":717
15272  * cdef _memoryviewslice memviewsliceobj
15273  *
15274  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
15275  *
15276  * if isinstance(memview, _memoryviewslice):
15277  */
15278  #ifndef CYTHON_WITHOUT_ASSERTIONS
15279  if (unlikely(!Py_OptimizeFlag)) {
15280  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15281  PyErr_SetNone(PyExc_AssertionError);
15282  __PYX_ERR(1, 717, __pyx_L1_error)
15283  }
15284  }
15285  #endif
15286 
15287  /* "View.MemoryView":719
15288  * assert memview.view.ndim > 0
15289  *
15290  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15291  * memviewsliceobj = memview
15292  * p_src = &memviewsliceobj.from_slice
15293  */
15294  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15295  __pyx_t_2 = (__pyx_t_1 != 0);
15296  if (__pyx_t_2) {
15297 
15298  /* "View.MemoryView":720
15299  *
15300  * if isinstance(memview, _memoryviewslice):
15301  * memviewsliceobj = memview # <<<<<<<<<<<<<<
15302  * p_src = &memviewsliceobj.from_slice
15303  * else:
15304  */
15305  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 720, __pyx_L1_error)
15306  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15307  __Pyx_INCREF(__pyx_t_3);
15308  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15309  __pyx_t_3 = 0;
15310 
15311  /* "View.MemoryView":721
15312  * if isinstance(memview, _memoryviewslice):
15313  * memviewsliceobj = memview
15314  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
15315  * else:
15316  * slice_copy(memview, &src)
15317  */
15318  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15319 
15320  /* "View.MemoryView":719
15321  * assert memview.view.ndim > 0
15322  *
15323  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15324  * memviewsliceobj = memview
15325  * p_src = &memviewsliceobj.from_slice
15326  */
15327  goto __pyx_L3;
15328  }
15329 
15330  /* "View.MemoryView":723
15331  * p_src = &memviewsliceobj.from_slice
15332  * else:
15333  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
15334  * p_src = &src
15335  *
15336  */
15337  /*else*/ {
15338  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15339 
15340  /* "View.MemoryView":724
15341  * else:
15342  * slice_copy(memview, &src)
15343  * p_src = &src # <<<<<<<<<<<<<<
15344  *
15345  *
15346  */
15347  __pyx_v_p_src = (&__pyx_v_src);
15348  }
15349  __pyx_L3:;
15350 
15351  /* "View.MemoryView":730
15352  *
15353  *
15354  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
15355  * dst.data = p_src.data
15356  *
15357  */
15358  __pyx_t_4 = __pyx_v_p_src->memview;
15359  __pyx_v_dst.memview = __pyx_t_4;
15360 
15361  /* "View.MemoryView":731
15362  *
15363  * dst.memview = p_src.memview
15364  * dst.data = p_src.data # <<<<<<<<<<<<<<
15365  *
15366  *
15367  */
15368  __pyx_t_5 = __pyx_v_p_src->data;
15369  __pyx_v_dst.data = __pyx_t_5;
15370 
15371  /* "View.MemoryView":736
15372  *
15373  *
15374  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
15375  * cdef int *p_suboffset_dim = &suboffset_dim
15376  * cdef Py_ssize_t start, stop, step
15377  */
15378  __pyx_v_p_dst = (&__pyx_v_dst);
15379 
15380  /* "View.MemoryView":737
15381  *
15382  * cdef __Pyx_memviewslice *p_dst = &dst
15383  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
15384  * cdef Py_ssize_t start, stop, step
15385  * cdef bint have_start, have_stop, have_step
15386  */
15387  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15388 
15389  /* "View.MemoryView":741
15390  * cdef bint have_start, have_stop, have_step
15391  *
15392  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15393  * if PyIndex_Check(index):
15394  * slice_memviewslice(
15395  */
15396  __pyx_t_6 = 0;
15397  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15398  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15399  __pyx_t_8 = NULL;
15400  } else {
15401  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 741, __pyx_L1_error)
15402  __Pyx_GOTREF(__pyx_t_3);
15403  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 741, __pyx_L1_error)
15404  }
15405  for (;;) {
15406  if (likely(!__pyx_t_8)) {
15407  if (likely(PyList_CheckExact(__pyx_t_3))) {
15408  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
15409  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15410  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 741, __pyx_L1_error)
15411  #else
15412  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 741, __pyx_L1_error)
15413  __Pyx_GOTREF(__pyx_t_9);
15414  #endif
15415  } else {
15416  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
15417  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15418  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 741, __pyx_L1_error)
15419  #else
15420  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 741, __pyx_L1_error)
15421  __Pyx_GOTREF(__pyx_t_9);
15422  #endif
15423  }
15424  } else {
15425  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15426  if (unlikely(!__pyx_t_9)) {
15427  PyObject* exc_type = PyErr_Occurred();
15428  if (exc_type) {
15429  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15430  else __PYX_ERR(1, 741, __pyx_L1_error)
15431  }
15432  break;
15433  }
15434  __Pyx_GOTREF(__pyx_t_9);
15435  }
15436  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15437  __pyx_t_9 = 0;
15438  __pyx_v_dim = __pyx_t_6;
15439  __pyx_t_6 = (__pyx_t_6 + 1);
15440 
15441  /* "View.MemoryView":742
15442  *
15443  * for dim, index in enumerate(indices):
15444  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15445  * slice_memviewslice(
15446  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15447  */
15448  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15449  if (__pyx_t_2) {
15450 
15451  /* "View.MemoryView":746
15452  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15453  * dim, new_ndim, p_suboffset_dim,
15454  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
15455  * 0, 0, 0, # have_{start,stop,step}
15456  * False)
15457  */
15458  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error)
15459 
15460  /* "View.MemoryView":743
15461  * for dim, index in enumerate(indices):
15462  * if PyIndex_Check(index):
15463  * slice_memviewslice( # <<<<<<<<<<<<<<
15464  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15465  * dim, new_ndim, p_suboffset_dim,
15466  */
15467  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 743, __pyx_L1_error)
15468 
15469  /* "View.MemoryView":742
15470  *
15471  * for dim, index in enumerate(indices):
15472  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15473  * slice_memviewslice(
15474  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15475  */
15476  goto __pyx_L6;
15477  }
15478 
15479  /* "View.MemoryView":749
15480  * 0, 0, 0, # have_{start,stop,step}
15481  * False)
15482  * elif index is None: # <<<<<<<<<<<<<<
15483  * p_dst.shape[new_ndim] = 1
15484  * p_dst.strides[new_ndim] = 0
15485  */
15486  __pyx_t_2 = (__pyx_v_index == Py_None);
15487  __pyx_t_1 = (__pyx_t_2 != 0);
15488  if (__pyx_t_1) {
15489 
15490  /* "View.MemoryView":750
15491  * False)
15492  * elif index is None:
15493  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
15494  * p_dst.strides[new_ndim] = 0
15495  * p_dst.suboffsets[new_ndim] = -1
15496  */
15497  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15498 
15499  /* "View.MemoryView":751
15500  * elif index is None:
15501  * p_dst.shape[new_ndim] = 1
15502  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
15503  * p_dst.suboffsets[new_ndim] = -1
15504  * new_ndim += 1
15505  */
15506  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15507 
15508  /* "View.MemoryView":752
15509  * p_dst.shape[new_ndim] = 1
15510  * p_dst.strides[new_ndim] = 0
15511  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
15512  * new_ndim += 1
15513  * else:
15514  */
15515  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15516 
15517  /* "View.MemoryView":753
15518  * p_dst.strides[new_ndim] = 0
15519  * p_dst.suboffsets[new_ndim] = -1
15520  * new_ndim += 1 # <<<<<<<<<<<<<<
15521  * else:
15522  * start = index.start or 0
15523  */
15524  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15525 
15526  /* "View.MemoryView":749
15527  * 0, 0, 0, # have_{start,stop,step}
15528  * False)
15529  * elif index is None: # <<<<<<<<<<<<<<
15530  * p_dst.shape[new_ndim] = 1
15531  * p_dst.strides[new_ndim] = 0
15532  */
15533  goto __pyx_L6;
15534  }
15535 
15536  /* "View.MemoryView":755
15537  * new_ndim += 1
15538  * else:
15539  * start = index.start or 0 # <<<<<<<<<<<<<<
15540  * stop = index.stop or 0
15541  * step = index.step or 0
15542  */
15543  /*else*/ {
15544  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 755, __pyx_L1_error)
15545  __Pyx_GOTREF(__pyx_t_9);
15546  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 755, __pyx_L1_error)
15547  if (!__pyx_t_1) {
15548  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15549  } else {
15550  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 755, __pyx_L1_error)
15551  __pyx_t_10 = __pyx_t_12;
15552  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15553  goto __pyx_L7_bool_binop_done;
15554  }
15555  __pyx_t_10 = 0;
15556  __pyx_L7_bool_binop_done:;
15557  __pyx_v_start = __pyx_t_10;
15558 
15559  /* "View.MemoryView":756
15560  * else:
15561  * start = index.start or 0
15562  * stop = index.stop or 0 # <<<<<<<<<<<<<<
15563  * step = index.step or 0
15564  *
15565  */
15566  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 756, __pyx_L1_error)
15567  __Pyx_GOTREF(__pyx_t_9);
15568  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 756, __pyx_L1_error)
15569  if (!__pyx_t_1) {
15570  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15571  } else {
15572  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 756, __pyx_L1_error)
15573  __pyx_t_10 = __pyx_t_12;
15574  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15575  goto __pyx_L9_bool_binop_done;
15576  }
15577  __pyx_t_10 = 0;
15578  __pyx_L9_bool_binop_done:;
15579  __pyx_v_stop = __pyx_t_10;
15580 
15581  /* "View.MemoryView":757
15582  * start = index.start or 0
15583  * stop = index.stop or 0
15584  * step = index.step or 0 # <<<<<<<<<<<<<<
15585  *
15586  * have_start = index.start is not None
15587  */
15588  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 757, __pyx_L1_error)
15589  __Pyx_GOTREF(__pyx_t_9);
15590  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 757, __pyx_L1_error)
15591  if (!__pyx_t_1) {
15592  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15593  } else {
15594  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error)
15595  __pyx_t_10 = __pyx_t_12;
15596  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15597  goto __pyx_L11_bool_binop_done;
15598  }
15599  __pyx_t_10 = 0;
15600  __pyx_L11_bool_binop_done:;
15601  __pyx_v_step = __pyx_t_10;
15602 
15603  /* "View.MemoryView":759
15604  * step = index.step or 0
15605  *
15606  * have_start = index.start is not None # <<<<<<<<<<<<<<
15607  * have_stop = index.stop is not None
15608  * have_step = index.step is not None
15609  */
15610  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 759, __pyx_L1_error)
15611  __Pyx_GOTREF(__pyx_t_9);
15612  __pyx_t_1 = (__pyx_t_9 != Py_None);
15613  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15614  __pyx_v_have_start = __pyx_t_1;
15615 
15616  /* "View.MemoryView":760
15617  *
15618  * have_start = index.start is not None
15619  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
15620  * have_step = index.step is not None
15621  *
15622  */
15623  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
15624  __Pyx_GOTREF(__pyx_t_9);
15625  __pyx_t_1 = (__pyx_t_9 != Py_None);
15626  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15627  __pyx_v_have_stop = __pyx_t_1;
15628 
15629  /* "View.MemoryView":761
15630  * have_start = index.start is not None
15631  * have_stop = index.stop is not None
15632  * have_step = index.step is not None # <<<<<<<<<<<<<<
15633  *
15634  * slice_memviewslice(
15635  */
15636  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
15637  __Pyx_GOTREF(__pyx_t_9);
15638  __pyx_t_1 = (__pyx_t_9 != Py_None);
15639  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15640  __pyx_v_have_step = __pyx_t_1;
15641 
15642  /* "View.MemoryView":763
15643  * have_step = index.step is not None
15644  *
15645  * slice_memviewslice( # <<<<<<<<<<<<<<
15646  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15647  * dim, new_ndim, p_suboffset_dim,
15648  */
15649  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 763, __pyx_L1_error)
15650 
15651  /* "View.MemoryView":769
15652  * have_start, have_stop, have_step,
15653  * True)
15654  * new_ndim += 1 # <<<<<<<<<<<<<<
15655  *
15656  * if isinstance(memview, _memoryviewslice):
15657  */
15658  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15659  }
15660  __pyx_L6:;
15661 
15662  /* "View.MemoryView":741
15663  * cdef bint have_start, have_stop, have_step
15664  *
15665  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15666  * if PyIndex_Check(index):
15667  * slice_memviewslice(
15668  */
15669  }
15670  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15671 
15672  /* "View.MemoryView":771
15673  * new_ndim += 1
15674  *
15675  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15676  * return memoryview_fromslice(dst, new_ndim,
15677  * memviewsliceobj.to_object_func,
15678  */
15679  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15680  __pyx_t_2 = (__pyx_t_1 != 0);
15681  if (__pyx_t_2) {
15682 
15683  /* "View.MemoryView":772
15684  *
15685  * if isinstance(memview, _memoryviewslice):
15686  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15687  * memviewsliceobj.to_object_func,
15688  * memviewsliceobj.to_dtype_func,
15689  */
15690  __Pyx_XDECREF(((PyObject *)__pyx_r));
15691 
15692  /* "View.MemoryView":773
15693  * if isinstance(memview, _memoryviewslice):
15694  * return memoryview_fromslice(dst, new_ndim,
15695  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
15696  * memviewsliceobj.to_dtype_func,
15697  * memview.dtype_is_object)
15698  */
15699  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 773, __pyx_L1_error) }
15700 
15701  /* "View.MemoryView":774
15702  * return memoryview_fromslice(dst, new_ndim,
15703  * memviewsliceobj.to_object_func,
15704  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
15705  * memview.dtype_is_object)
15706  * else:
15707  */
15708  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 774, __pyx_L1_error) }
15709 
15710  /* "View.MemoryView":772
15711  *
15712  * if isinstance(memview, _memoryviewslice):
15713  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15714  * memviewsliceobj.to_object_func,
15715  * memviewsliceobj.to_dtype_func,
15716  */
15717  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 772, __pyx_L1_error)
15718  __Pyx_GOTREF(__pyx_t_3);
15719  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 772, __pyx_L1_error)
15720  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15721  __pyx_t_3 = 0;
15722  goto __pyx_L0;
15723 
15724  /* "View.MemoryView":771
15725  * new_ndim += 1
15726  *
15727  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15728  * return memoryview_fromslice(dst, new_ndim,
15729  * memviewsliceobj.to_object_func,
15730  */
15731  }
15732 
15733  /* "View.MemoryView":777
15734  * memview.dtype_is_object)
15735  * else:
15736  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15737  * memview.dtype_is_object)
15738  *
15739  */
15740  /*else*/ {
15741  __Pyx_XDECREF(((PyObject *)__pyx_r));
15742 
15743  /* "View.MemoryView":778
15744  * else:
15745  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
15746  * memview.dtype_is_object) # <<<<<<<<<<<<<<
15747  *
15748  *
15749  */
15750  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
15751  __Pyx_GOTREF(__pyx_t_3);
15752 
15753  /* "View.MemoryView":777
15754  * memview.dtype_is_object)
15755  * else:
15756  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15757  * memview.dtype_is_object)
15758  *
15759  */
15760  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
15761  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15762  __pyx_t_3 = 0;
15763  goto __pyx_L0;
15764  }
15765 
15766  /* "View.MemoryView":705
15767  *
15768  * @cname('__pyx_memview_slice')
15769  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15770  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15771  * cdef bint negative_step
15772  */
15773 
15774  /* function exit code */
15775  __pyx_L1_error:;
15776  __Pyx_XDECREF(__pyx_t_3);
15777  __Pyx_XDECREF(__pyx_t_9);
15778  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15779  __pyx_r = 0;
15780  __pyx_L0:;
15781  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15782  __Pyx_XDECREF(__pyx_v_index);
15783  __Pyx_XGIVEREF((PyObject *)__pyx_r);
15784  __Pyx_RefNannyFinishContext();
15785  return __pyx_r;
15786 }
15787 
15788 /* "View.MemoryView":802
15789  *
15790  * @cname('__pyx_memoryview_slice_memviewslice')
15791  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15792  * __Pyx_memviewslice *dst,
15793  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15794  */
15795 
15796 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
15797  Py_ssize_t __pyx_v_new_shape;
15798  int __pyx_v_negative_step;
15799  int __pyx_r;
15800  int __pyx_t_1;
15801  int __pyx_t_2;
15802  int __pyx_t_3;
15803 
15804  /* "View.MemoryView":822
15805  * cdef bint negative_step
15806  *
15807  * if not is_slice: # <<<<<<<<<<<<<<
15808  *
15809  * if start < 0:
15810  */
15811  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15812  if (__pyx_t_1) {
15813 
15814  /* "View.MemoryView":824
15815  * if not is_slice:
15816  *
15817  * if start < 0: # <<<<<<<<<<<<<<
15818  * start += shape
15819  * if not 0 <= start < shape:
15820  */
15821  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15822  if (__pyx_t_1) {
15823 
15824  /* "View.MemoryView":825
15825  *
15826  * if start < 0:
15827  * start += shape # <<<<<<<<<<<<<<
15828  * if not 0 <= start < shape:
15829  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15830  */
15831  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15832 
15833  /* "View.MemoryView":824
15834  * if not is_slice:
15835  *
15836  * if start < 0: # <<<<<<<<<<<<<<
15837  * start += shape
15838  * if not 0 <= start < shape:
15839  */
15840  }
15841 
15842  /* "View.MemoryView":826
15843  * if start < 0:
15844  * start += shape
15845  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15846  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15847  * else:
15848  */
15849  __pyx_t_1 = (0 <= __pyx_v_start);
15850  if (__pyx_t_1) {
15851  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15852  }
15853  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15854  if (__pyx_t_2) {
15855 
15856  /* "View.MemoryView":827
15857  * start += shape
15858  * if not 0 <= start < shape:
15859  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
15860  * else:
15861  *
15862  */
15863  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 827, __pyx_L1_error)
15864 
15865  /* "View.MemoryView":826
15866  * if start < 0:
15867  * start += shape
15868  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15869  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15870  * else:
15871  */
15872  }
15873 
15874  /* "View.MemoryView":822
15875  * cdef bint negative_step
15876  *
15877  * if not is_slice: # <<<<<<<<<<<<<<
15878  *
15879  * if start < 0:
15880  */
15881  goto __pyx_L3;
15882  }
15883 
15884  /* "View.MemoryView":830
15885  * else:
15886  *
15887  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
15888  *
15889  * if have_step and step == 0:
15890  */
15891  /*else*/ {
15892  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15893  if (__pyx_t_1) {
15894  } else {
15895  __pyx_t_2 = __pyx_t_1;
15896  goto __pyx_L6_bool_binop_done;
15897  }
15898  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15899  __pyx_t_2 = __pyx_t_1;
15900  __pyx_L6_bool_binop_done:;
15901  __pyx_v_negative_step = __pyx_t_2;
15902 
15903  /* "View.MemoryView":832
15904  * negative_step = have_step != 0 and step < 0
15905  *
15906  * if have_step and step == 0: # <<<<<<<<<<<<<<
15907  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15908  *
15909  */
15910  __pyx_t_1 = (__pyx_v_have_step != 0);
15911  if (__pyx_t_1) {
15912  } else {
15913  __pyx_t_2 = __pyx_t_1;
15914  goto __pyx_L9_bool_binop_done;
15915  }
15916  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15917  __pyx_t_2 = __pyx_t_1;
15918  __pyx_L9_bool_binop_done:;
15919  if (__pyx_t_2) {
15920 
15921  /* "View.MemoryView":833
15922  *
15923  * if have_step and step == 0:
15924  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
15925  *
15926  *
15927  */
15928  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 833, __pyx_L1_error)
15929 
15930  /* "View.MemoryView":832
15931  * negative_step = have_step != 0 and step < 0
15932  *
15933  * if have_step and step == 0: # <<<<<<<<<<<<<<
15934  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15935  *
15936  */
15937  }
15938 
15939  /* "View.MemoryView":836
15940  *
15941  *
15942  * if have_start: # <<<<<<<<<<<<<<
15943  * if start < 0:
15944  * start += shape
15945  */
15946  __pyx_t_2 = (__pyx_v_have_start != 0);
15947  if (__pyx_t_2) {
15948 
15949  /* "View.MemoryView":837
15950  *
15951  * if have_start:
15952  * if start < 0: # <<<<<<<<<<<<<<
15953  * start += shape
15954  * if start < 0:
15955  */
15956  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15957  if (__pyx_t_2) {
15958 
15959  /* "View.MemoryView":838
15960  * if have_start:
15961  * if start < 0:
15962  * start += shape # <<<<<<<<<<<<<<
15963  * if start < 0:
15964  * start = 0
15965  */
15966  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15967 
15968  /* "View.MemoryView":839
15969  * if start < 0:
15970  * start += shape
15971  * if start < 0: # <<<<<<<<<<<<<<
15972  * start = 0
15973  * elif start >= shape:
15974  */
15975  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15976  if (__pyx_t_2) {
15977 
15978  /* "View.MemoryView":840
15979  * start += shape
15980  * if start < 0:
15981  * start = 0 # <<<<<<<<<<<<<<
15982  * elif start >= shape:
15983  * if negative_step:
15984  */
15985  __pyx_v_start = 0;
15986 
15987  /* "View.MemoryView":839
15988  * if start < 0:
15989  * start += shape
15990  * if start < 0: # <<<<<<<<<<<<<<
15991  * start = 0
15992  * elif start >= shape:
15993  */
15994  }
15995 
15996  /* "View.MemoryView":837
15997  *
15998  * if have_start:
15999  * if start < 0: # <<<<<<<<<<<<<<
16000  * start += shape
16001  * if start < 0:
16002  */
16003  goto __pyx_L12;
16004  }
16005 
16006  /* "View.MemoryView":841
16007  * if start < 0:
16008  * start = 0
16009  * elif start >= shape: # <<<<<<<<<<<<<<
16010  * if negative_step:
16011  * start = shape - 1
16012  */
16013  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16014  if (__pyx_t_2) {
16015 
16016  /* "View.MemoryView":842
16017  * start = 0
16018  * elif start >= shape:
16019  * if negative_step: # <<<<<<<<<<<<<<
16020  * start = shape - 1
16021  * else:
16022  */
16023  __pyx_t_2 = (__pyx_v_negative_step != 0);
16024  if (__pyx_t_2) {
16025 
16026  /* "View.MemoryView":843
16027  * elif start >= shape:
16028  * if negative_step:
16029  * start = shape - 1 # <<<<<<<<<<<<<<
16030  * else:
16031  * start = shape
16032  */
16033  __pyx_v_start = (__pyx_v_shape - 1);
16034 
16035  /* "View.MemoryView":842
16036  * start = 0
16037  * elif start >= shape:
16038  * if negative_step: # <<<<<<<<<<<<<<
16039  * start = shape - 1
16040  * else:
16041  */
16042  goto __pyx_L14;
16043  }
16044 
16045  /* "View.MemoryView":845
16046  * start = shape - 1
16047  * else:
16048  * start = shape # <<<<<<<<<<<<<<
16049  * else:
16050  * if negative_step:
16051  */
16052  /*else*/ {
16053  __pyx_v_start = __pyx_v_shape;
16054  }
16055  __pyx_L14:;
16056 
16057  /* "View.MemoryView":841
16058  * if start < 0:
16059  * start = 0
16060  * elif start >= shape: # <<<<<<<<<<<<<<
16061  * if negative_step:
16062  * start = shape - 1
16063  */
16064  }
16065  __pyx_L12:;
16066 
16067  /* "View.MemoryView":836
16068  *
16069  *
16070  * if have_start: # <<<<<<<<<<<<<<
16071  * if start < 0:
16072  * start += shape
16073  */
16074  goto __pyx_L11;
16075  }
16076 
16077  /* "View.MemoryView":847
16078  * start = shape
16079  * else:
16080  * if negative_step: # <<<<<<<<<<<<<<
16081  * start = shape - 1
16082  * else:
16083  */
16084  /*else*/ {
16085  __pyx_t_2 = (__pyx_v_negative_step != 0);
16086  if (__pyx_t_2) {
16087 
16088  /* "View.MemoryView":848
16089  * else:
16090  * if negative_step:
16091  * start = shape - 1 # <<<<<<<<<<<<<<
16092  * else:
16093  * start = 0
16094  */
16095  __pyx_v_start = (__pyx_v_shape - 1);
16096 
16097  /* "View.MemoryView":847
16098  * start = shape
16099  * else:
16100  * if negative_step: # <<<<<<<<<<<<<<
16101  * start = shape - 1
16102  * else:
16103  */
16104  goto __pyx_L15;
16105  }
16106 
16107  /* "View.MemoryView":850
16108  * start = shape - 1
16109  * else:
16110  * start = 0 # <<<<<<<<<<<<<<
16111  *
16112  * if have_stop:
16113  */
16114  /*else*/ {
16115  __pyx_v_start = 0;
16116  }
16117  __pyx_L15:;
16118  }
16119  __pyx_L11:;
16120 
16121  /* "View.MemoryView":852
16122  * start = 0
16123  *
16124  * if have_stop: # <<<<<<<<<<<<<<
16125  * if stop < 0:
16126  * stop += shape
16127  */
16128  __pyx_t_2 = (__pyx_v_have_stop != 0);
16129  if (__pyx_t_2) {
16130 
16131  /* "View.MemoryView":853
16132  *
16133  * if have_stop:
16134  * if stop < 0: # <<<<<<<<<<<<<<
16135  * stop += shape
16136  * if stop < 0:
16137  */
16138  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16139  if (__pyx_t_2) {
16140 
16141  /* "View.MemoryView":854
16142  * if have_stop:
16143  * if stop < 0:
16144  * stop += shape # <<<<<<<<<<<<<<
16145  * if stop < 0:
16146  * stop = 0
16147  */
16148  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16149 
16150  /* "View.MemoryView":855
16151  * if stop < 0:
16152  * stop += shape
16153  * if stop < 0: # <<<<<<<<<<<<<<
16154  * stop = 0
16155  * elif stop > shape:
16156  */
16157  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16158  if (__pyx_t_2) {
16159 
16160  /* "View.MemoryView":856
16161  * stop += shape
16162  * if stop < 0:
16163  * stop = 0 # <<<<<<<<<<<<<<
16164  * elif stop > shape:
16165  * stop = shape
16166  */
16167  __pyx_v_stop = 0;
16168 
16169  /* "View.MemoryView":855
16170  * if stop < 0:
16171  * stop += shape
16172  * if stop < 0: # <<<<<<<<<<<<<<
16173  * stop = 0
16174  * elif stop > shape:
16175  */
16176  }
16177 
16178  /* "View.MemoryView":853
16179  *
16180  * if have_stop:
16181  * if stop < 0: # <<<<<<<<<<<<<<
16182  * stop += shape
16183  * if stop < 0:
16184  */
16185  goto __pyx_L17;
16186  }
16187 
16188  /* "View.MemoryView":857
16189  * if stop < 0:
16190  * stop = 0
16191  * elif stop > shape: # <<<<<<<<<<<<<<
16192  * stop = shape
16193  * else:
16194  */
16195  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16196  if (__pyx_t_2) {
16197 
16198  /* "View.MemoryView":858
16199  * stop = 0
16200  * elif stop > shape:
16201  * stop = shape # <<<<<<<<<<<<<<
16202  * else:
16203  * if negative_step:
16204  */
16205  __pyx_v_stop = __pyx_v_shape;
16206 
16207  /* "View.MemoryView":857
16208  * if stop < 0:
16209  * stop = 0
16210  * elif stop > shape: # <<<<<<<<<<<<<<
16211  * stop = shape
16212  * else:
16213  */
16214  }
16215  __pyx_L17:;
16216 
16217  /* "View.MemoryView":852
16218  * start = 0
16219  *
16220  * if have_stop: # <<<<<<<<<<<<<<
16221  * if stop < 0:
16222  * stop += shape
16223  */
16224  goto __pyx_L16;
16225  }
16226 
16227  /* "View.MemoryView":860
16228  * stop = shape
16229  * else:
16230  * if negative_step: # <<<<<<<<<<<<<<
16231  * stop = -1
16232  * else:
16233  */
16234  /*else*/ {
16235  __pyx_t_2 = (__pyx_v_negative_step != 0);
16236  if (__pyx_t_2) {
16237 
16238  /* "View.MemoryView":861
16239  * else:
16240  * if negative_step:
16241  * stop = -1 # <<<<<<<<<<<<<<
16242  * else:
16243  * stop = shape
16244  */
16245  __pyx_v_stop = -1L;
16246 
16247  /* "View.MemoryView":860
16248  * stop = shape
16249  * else:
16250  * if negative_step: # <<<<<<<<<<<<<<
16251  * stop = -1
16252  * else:
16253  */
16254  goto __pyx_L19;
16255  }
16256 
16257  /* "View.MemoryView":863
16258  * stop = -1
16259  * else:
16260  * stop = shape # <<<<<<<<<<<<<<
16261  *
16262  * if not have_step:
16263  */
16264  /*else*/ {
16265  __pyx_v_stop = __pyx_v_shape;
16266  }
16267  __pyx_L19:;
16268  }
16269  __pyx_L16:;
16270 
16271  /* "View.MemoryView":865
16272  * stop = shape
16273  *
16274  * if not have_step: # <<<<<<<<<<<<<<
16275  * step = 1
16276  *
16277  */
16278  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16279  if (__pyx_t_2) {
16280 
16281  /* "View.MemoryView":866
16282  *
16283  * if not have_step:
16284  * step = 1 # <<<<<<<<<<<<<<
16285  *
16286  *
16287  */
16288  __pyx_v_step = 1;
16289 
16290  /* "View.MemoryView":865
16291  * stop = shape
16292  *
16293  * if not have_step: # <<<<<<<<<<<<<<
16294  * step = 1
16295  *
16296  */
16297  }
16298 
16299  /* "View.MemoryView":870
16300  *
16301  * with cython.cdivision(True):
16302  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
16303  *
16304  * if (stop - start) - step * new_shape:
16305  */
16306  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16307 
16308  /* "View.MemoryView":872
16309  * new_shape = (stop - start) // step
16310  *
16311  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16312  * new_shape += 1
16313  *
16314  */
16315  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16316  if (__pyx_t_2) {
16317 
16318  /* "View.MemoryView":873
16319  *
16320  * if (stop - start) - step * new_shape:
16321  * new_shape += 1 # <<<<<<<<<<<<<<
16322  *
16323  * if new_shape < 0:
16324  */
16325  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16326 
16327  /* "View.MemoryView":872
16328  * new_shape = (stop - start) // step
16329  *
16330  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16331  * new_shape += 1
16332  *
16333  */
16334  }
16335 
16336  /* "View.MemoryView":875
16337  * new_shape += 1
16338  *
16339  * if new_shape < 0: # <<<<<<<<<<<<<<
16340  * new_shape = 0
16341  *
16342  */
16343  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16344  if (__pyx_t_2) {
16345 
16346  /* "View.MemoryView":876
16347  *
16348  * if new_shape < 0:
16349  * new_shape = 0 # <<<<<<<<<<<<<<
16350  *
16351  *
16352  */
16353  __pyx_v_new_shape = 0;
16354 
16355  /* "View.MemoryView":875
16356  * new_shape += 1
16357  *
16358  * if new_shape < 0: # <<<<<<<<<<<<<<
16359  * new_shape = 0
16360  *
16361  */
16362  }
16363 
16364  /* "View.MemoryView":879
16365  *
16366  *
16367  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
16368  * dst.shape[new_ndim] = new_shape
16369  * dst.suboffsets[new_ndim] = suboffset
16370  */
16371  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16372 
16373  /* "View.MemoryView":880
16374  *
16375  * dst.strides[new_ndim] = stride * step
16376  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
16377  * dst.suboffsets[new_ndim] = suboffset
16378  *
16379  */
16380  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16381 
16382  /* "View.MemoryView":881
16383  * dst.strides[new_ndim] = stride * step
16384  * dst.shape[new_ndim] = new_shape
16385  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
16386  *
16387  *
16388  */
16389  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16390  }
16391  __pyx_L3:;
16392 
16393  /* "View.MemoryView":884
16394  *
16395  *
16396  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16397  * dst.data += start * stride
16398  * else:
16399  */
16400  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16401  if (__pyx_t_2) {
16402 
16403  /* "View.MemoryView":885
16404  *
16405  * if suboffset_dim[0] < 0:
16406  * dst.data += start * stride # <<<<<<<<<<<<<<
16407  * else:
16408  * dst.suboffsets[suboffset_dim[0]] += start * stride
16409  */
16410  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16411 
16412  /* "View.MemoryView":884
16413  *
16414  *
16415  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16416  * dst.data += start * stride
16417  * else:
16418  */
16419  goto __pyx_L23;
16420  }
16421 
16422  /* "View.MemoryView":887
16423  * dst.data += start * stride
16424  * else:
16425  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
16426  *
16427  * if suboffset >= 0:
16428  */
16429  /*else*/ {
16430  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16431  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16432  }
16433  __pyx_L23:;
16434 
16435  /* "View.MemoryView":889
16436  * dst.suboffsets[suboffset_dim[0]] += start * stride
16437  *
16438  * if suboffset >= 0: # <<<<<<<<<<<<<<
16439  * if not is_slice:
16440  * if new_ndim == 0:
16441  */
16442  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16443  if (__pyx_t_2) {
16444 
16445  /* "View.MemoryView":890
16446  *
16447  * if suboffset >= 0:
16448  * if not is_slice: # <<<<<<<<<<<<<<
16449  * if new_ndim == 0:
16450  * dst.data = (<char **> dst.data)[0] + suboffset
16451  */
16452  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16453  if (__pyx_t_2) {
16454 
16455  /* "View.MemoryView":891
16456  * if suboffset >= 0:
16457  * if not is_slice:
16458  * if new_ndim == 0: # <<<<<<<<<<<<<<
16459  * dst.data = (<char **> dst.data)[0] + suboffset
16460  * else:
16461  */
16462  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16463  if (__pyx_t_2) {
16464 
16465  /* "View.MemoryView":892
16466  * if not is_slice:
16467  * if new_ndim == 0:
16468  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
16469  * else:
16470  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16471  */
16472  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16473 
16474  /* "View.MemoryView":891
16475  * if suboffset >= 0:
16476  * if not is_slice:
16477  * if new_ndim == 0: # <<<<<<<<<<<<<<
16478  * dst.data = (<char **> dst.data)[0] + suboffset
16479  * else:
16480  */
16481  goto __pyx_L26;
16482  }
16483 
16484  /* "View.MemoryView":894
16485  * dst.data = (<char **> dst.data)[0] + suboffset
16486  * else:
16487  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
16488  * "must be indexed and not sliced", dim)
16489  * else:
16490  */
16491  /*else*/ {
16492 
16493  /* "View.MemoryView":895
16494  * else:
16495  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16496  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
16497  * else:
16498  * suboffset_dim[0] = new_ndim
16499  */
16500  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 894, __pyx_L1_error)
16501  }
16502  __pyx_L26:;
16503 
16504  /* "View.MemoryView":890
16505  *
16506  * if suboffset >= 0:
16507  * if not is_slice: # <<<<<<<<<<<<<<
16508  * if new_ndim == 0:
16509  * dst.data = (<char **> dst.data)[0] + suboffset
16510  */
16511  goto __pyx_L25;
16512  }
16513 
16514  /* "View.MemoryView":897
16515  * "must be indexed and not sliced", dim)
16516  * else:
16517  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
16518  *
16519  * return 0
16520  */
16521  /*else*/ {
16522  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16523  }
16524  __pyx_L25:;
16525 
16526  /* "View.MemoryView":889
16527  * dst.suboffsets[suboffset_dim[0]] += start * stride
16528  *
16529  * if suboffset >= 0: # <<<<<<<<<<<<<<
16530  * if not is_slice:
16531  * if new_ndim == 0:
16532  */
16533  }
16534 
16535  /* "View.MemoryView":899
16536  * suboffset_dim[0] = new_ndim
16537  *
16538  * return 0 # <<<<<<<<<<<<<<
16539  *
16540  *
16541  */
16542  __pyx_r = 0;
16543  goto __pyx_L0;
16544 
16545  /* "View.MemoryView":802
16546  *
16547  * @cname('__pyx_memoryview_slice_memviewslice')
16548  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16549  * __Pyx_memviewslice *dst,
16550  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16551  */
16552 
16553  /* function exit code */
16554  __pyx_L1_error:;
16555  {
16556  #ifdef WITH_THREAD
16557  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16558  #endif
16559  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16560  #ifdef WITH_THREAD
16561  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16562  #endif
16563  }
16564  __pyx_r = -1;
16565  __pyx_L0:;
16566  return __pyx_r;
16567 }
16568 
16569 /* "View.MemoryView":905
16570  *
16571  * @cname('__pyx_pybuffer_index')
16572  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16573  * Py_ssize_t dim) except NULL:
16574  * cdef Py_ssize_t shape, stride, suboffset = -1
16575  */
16576 
16577 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16578  Py_ssize_t __pyx_v_shape;
16579  Py_ssize_t __pyx_v_stride;
16580  Py_ssize_t __pyx_v_suboffset;
16581  Py_ssize_t __pyx_v_itemsize;
16582  char *__pyx_v_resultp;
16583  char *__pyx_r;
16584  __Pyx_RefNannyDeclarations
16585  Py_ssize_t __pyx_t_1;
16586  int __pyx_t_2;
16587  PyObject *__pyx_t_3 = NULL;
16588  PyObject *__pyx_t_4 = NULL;
16589  __Pyx_RefNannySetupContext("pybuffer_index", 0);
16590 
16591  /* "View.MemoryView":907
16592  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
16593  * Py_ssize_t dim) except NULL:
16594  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
16595  * cdef Py_ssize_t itemsize = view.itemsize
16596  * cdef char *resultp
16597  */
16598  __pyx_v_suboffset = -1L;
16599 
16600  /* "View.MemoryView":908
16601  * Py_ssize_t dim) except NULL:
16602  * cdef Py_ssize_t shape, stride, suboffset = -1
16603  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
16604  * cdef char *resultp
16605  *
16606  */
16607  __pyx_t_1 = __pyx_v_view->itemsize;
16608  __pyx_v_itemsize = __pyx_t_1;
16609 
16610  /* "View.MemoryView":911
16611  * cdef char *resultp
16612  *
16613  * if view.ndim == 0: # <<<<<<<<<<<<<<
16614  * shape = view.len / itemsize
16615  * stride = itemsize
16616  */
16617  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16618  if (__pyx_t_2) {
16619 
16620  /* "View.MemoryView":912
16621  *
16622  * if view.ndim == 0:
16623  * shape = view.len / itemsize # <<<<<<<<<<<<<<
16624  * stride = itemsize
16625  * else:
16626  */
16627  if (unlikely(__pyx_v_itemsize == 0)) {
16628  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
16629  __PYX_ERR(1, 912, __pyx_L1_error)
16630  }
16631  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16632  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
16633  __PYX_ERR(1, 912, __pyx_L1_error)
16634  }
16635  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16636 
16637  /* "View.MemoryView":913
16638  * if view.ndim == 0:
16639  * shape = view.len / itemsize
16640  * stride = itemsize # <<<<<<<<<<<<<<
16641  * else:
16642  * shape = view.shape[dim]
16643  */
16644  __pyx_v_stride = __pyx_v_itemsize;
16645 
16646  /* "View.MemoryView":911
16647  * cdef char *resultp
16648  *
16649  * if view.ndim == 0: # <<<<<<<<<<<<<<
16650  * shape = view.len / itemsize
16651  * stride = itemsize
16652  */
16653  goto __pyx_L3;
16654  }
16655 
16656  /* "View.MemoryView":915
16657  * stride = itemsize
16658  * else:
16659  * shape = view.shape[dim] # <<<<<<<<<<<<<<
16660  * stride = view.strides[dim]
16661  * if view.suboffsets != NULL:
16662  */
16663  /*else*/ {
16664  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16665 
16666  /* "View.MemoryView":916
16667  * else:
16668  * shape = view.shape[dim]
16669  * stride = view.strides[dim] # <<<<<<<<<<<<<<
16670  * if view.suboffsets != NULL:
16671  * suboffset = view.suboffsets[dim]
16672  */
16673  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16674 
16675  /* "View.MemoryView":917
16676  * shape = view.shape[dim]
16677  * stride = view.strides[dim]
16678  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16679  * suboffset = view.suboffsets[dim]
16680  *
16681  */
16682  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16683  if (__pyx_t_2) {
16684 
16685  /* "View.MemoryView":918
16686  * stride = view.strides[dim]
16687  * if view.suboffsets != NULL:
16688  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
16689  *
16690  * if index < 0:
16691  */
16692  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16693 
16694  /* "View.MemoryView":917
16695  * shape = view.shape[dim]
16696  * stride = view.strides[dim]
16697  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16698  * suboffset = view.suboffsets[dim]
16699  *
16700  */
16701  }
16702  }
16703  __pyx_L3:;
16704 
16705  /* "View.MemoryView":920
16706  * suboffset = view.suboffsets[dim]
16707  *
16708  * if index < 0: # <<<<<<<<<<<<<<
16709  * index += view.shape[dim]
16710  * if index < 0:
16711  */
16712  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16713  if (__pyx_t_2) {
16714 
16715  /* "View.MemoryView":921
16716  *
16717  * if index < 0:
16718  * index += view.shape[dim] # <<<<<<<<<<<<<<
16719  * if index < 0:
16720  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16721  */
16722  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16723 
16724  /* "View.MemoryView":922
16725  * if index < 0:
16726  * index += view.shape[dim]
16727  * if index < 0: # <<<<<<<<<<<<<<
16728  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16729  *
16730  */
16731  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16732  if (unlikely(__pyx_t_2)) {
16733 
16734  /* "View.MemoryView":923
16735  * index += view.shape[dim]
16736  * if index < 0:
16737  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16738  *
16739  * if index >= shape:
16740  */
16741  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error)
16742  __Pyx_GOTREF(__pyx_t_3);
16743  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 923, __pyx_L1_error)
16744  __Pyx_GOTREF(__pyx_t_4);
16745  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16746  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error)
16747  __Pyx_GOTREF(__pyx_t_3);
16748  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16749  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16750  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16751  __PYX_ERR(1, 923, __pyx_L1_error)
16752 
16753  /* "View.MemoryView":922
16754  * if index < 0:
16755  * index += view.shape[dim]
16756  * if index < 0: # <<<<<<<<<<<<<<
16757  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16758  *
16759  */
16760  }
16761 
16762  /* "View.MemoryView":920
16763  * suboffset = view.suboffsets[dim]
16764  *
16765  * if index < 0: # <<<<<<<<<<<<<<
16766  * index += view.shape[dim]
16767  * if index < 0:
16768  */
16769  }
16770 
16771  /* "View.MemoryView":925
16772  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16773  *
16774  * if index >= shape: # <<<<<<<<<<<<<<
16775  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16776  *
16777  */
16778  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16779  if (unlikely(__pyx_t_2)) {
16780 
16781  /* "View.MemoryView":926
16782  *
16783  * if index >= shape:
16784  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16785  *
16786  * resultp = bufp + index * stride
16787  */
16788  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __pyx_L1_error)
16789  __Pyx_GOTREF(__pyx_t_3);
16790  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 926, __pyx_L1_error)
16791  __Pyx_GOTREF(__pyx_t_4);
16792  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16793  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __pyx_L1_error)
16794  __Pyx_GOTREF(__pyx_t_3);
16795  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16796  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16797  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16798  __PYX_ERR(1, 926, __pyx_L1_error)
16799 
16800  /* "View.MemoryView":925
16801  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16802  *
16803  * if index >= shape: # <<<<<<<<<<<<<<
16804  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16805  *
16806  */
16807  }
16808 
16809  /* "View.MemoryView":928
16810  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16811  *
16812  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
16813  * if suboffset >= 0:
16814  * resultp = (<char **> resultp)[0] + suboffset
16815  */
16816  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16817 
16818  /* "View.MemoryView":929
16819  *
16820  * resultp = bufp + index * stride
16821  * if suboffset >= 0: # <<<<<<<<<<<<<<
16822  * resultp = (<char **> resultp)[0] + suboffset
16823  *
16824  */
16825  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16826  if (__pyx_t_2) {
16827 
16828  /* "View.MemoryView":930
16829  * resultp = bufp + index * stride
16830  * if suboffset >= 0:
16831  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
16832  *
16833  * return resultp
16834  */
16835  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16836 
16837  /* "View.MemoryView":929
16838  *
16839  * resultp = bufp + index * stride
16840  * if suboffset >= 0: # <<<<<<<<<<<<<<
16841  * resultp = (<char **> resultp)[0] + suboffset
16842  *
16843  */
16844  }
16845 
16846  /* "View.MemoryView":932
16847  * resultp = (<char **> resultp)[0] + suboffset
16848  *
16849  * return resultp # <<<<<<<<<<<<<<
16850  *
16851  *
16852  */
16853  __pyx_r = __pyx_v_resultp;
16854  goto __pyx_L0;
16855 
16856  /* "View.MemoryView":905
16857  *
16858  * @cname('__pyx_pybuffer_index')
16859  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16860  * Py_ssize_t dim) except NULL:
16861  * cdef Py_ssize_t shape, stride, suboffset = -1
16862  */
16863 
16864  /* function exit code */
16865  __pyx_L1_error:;
16866  __Pyx_XDECREF(__pyx_t_3);
16867  __Pyx_XDECREF(__pyx_t_4);
16868  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16869  __pyx_r = NULL;
16870  __pyx_L0:;
16871  __Pyx_RefNannyFinishContext();
16872  return __pyx_r;
16873 }
16874 
16875 /* "View.MemoryView":938
16876  *
16877  * @cname('__pyx_memslice_transpose')
16878  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16879  * cdef int ndim = memslice.memview.view.ndim
16880  *
16881  */
16882 
16883 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16884  int __pyx_v_ndim;
16885  Py_ssize_t *__pyx_v_shape;
16886  Py_ssize_t *__pyx_v_strides;
16887  int __pyx_v_i;
16888  int __pyx_v_j;
16889  int __pyx_r;
16890  int __pyx_t_1;
16891  Py_ssize_t *__pyx_t_2;
16892  long __pyx_t_3;
16893  long __pyx_t_4;
16894  Py_ssize_t __pyx_t_5;
16895  Py_ssize_t __pyx_t_6;
16896  int __pyx_t_7;
16897  int __pyx_t_8;
16898  int __pyx_t_9;
16899 
16900  /* "View.MemoryView":939
16901  * @cname('__pyx_memslice_transpose')
16902  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
16903  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
16904  *
16905  * cdef Py_ssize_t *shape = memslice.shape
16906  */
16907  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16908  __pyx_v_ndim = __pyx_t_1;
16909 
16910  /* "View.MemoryView":941
16911  * cdef int ndim = memslice.memview.view.ndim
16912  *
16913  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
16914  * cdef Py_ssize_t *strides = memslice.strides
16915  *
16916  */
16917  __pyx_t_2 = __pyx_v_memslice->shape;
16918  __pyx_v_shape = __pyx_t_2;
16919 
16920  /* "View.MemoryView":942
16921  *
16922  * cdef Py_ssize_t *shape = memslice.shape
16923  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
16924  *
16925  *
16926  */
16927  __pyx_t_2 = __pyx_v_memslice->strides;
16928  __pyx_v_strides = __pyx_t_2;
16929 
16930  /* "View.MemoryView":946
16931  *
16932  * cdef int i, j
16933  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
16934  * j = ndim - 1 - i
16935  * strides[i], strides[j] = strides[j], strides[i]
16936  */
16937  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
16938  __pyx_t_4 = __pyx_t_3;
16939  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16940  __pyx_v_i = __pyx_t_1;
16941 
16942  /* "View.MemoryView":947
16943  * cdef int i, j
16944  * for i in range(ndim / 2):
16945  * j = ndim - 1 - i # <<<<<<<<<<<<<<
16946  * strides[i], strides[j] = strides[j], strides[i]
16947  * shape[i], shape[j] = shape[j], shape[i]
16948  */
16949  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16950 
16951  /* "View.MemoryView":948
16952  * for i in range(ndim / 2):
16953  * j = ndim - 1 - i
16954  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
16955  * shape[i], shape[j] = shape[j], shape[i]
16956  *
16957  */
16958  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16959  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16960  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16961  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16962 
16963  /* "View.MemoryView":949
16964  * j = ndim - 1 - i
16965  * strides[i], strides[j] = strides[j], strides[i]
16966  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
16967  *
16968  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16969  */
16970  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16971  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16972  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16973  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16974 
16975  /* "View.MemoryView":951
16976  * shape[i], shape[j] = shape[j], shape[i]
16977  *
16978  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16979  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16980  *
16981  */
16982  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16983  if (!__pyx_t_8) {
16984  } else {
16985  __pyx_t_7 = __pyx_t_8;
16986  goto __pyx_L6_bool_binop_done;
16987  }
16988  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16989  __pyx_t_7 = __pyx_t_8;
16990  __pyx_L6_bool_binop_done:;
16991  if (__pyx_t_7) {
16992 
16993  /* "View.MemoryView":952
16994  *
16995  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16996  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
16997  *
16998  * return 1
16999  */
17000  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 952, __pyx_L1_error)
17001 
17002  /* "View.MemoryView":951
17003  * shape[i], shape[j] = shape[j], shape[i]
17004  *
17005  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17006  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17007  *
17008  */
17009  }
17010  }
17011 
17012  /* "View.MemoryView":954
17013  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17014  *
17015  * return 1 # <<<<<<<<<<<<<<
17016  *
17017  *
17018  */
17019  __pyx_r = 1;
17020  goto __pyx_L0;
17021 
17022  /* "View.MemoryView":938
17023  *
17024  * @cname('__pyx_memslice_transpose')
17025  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17026  * cdef int ndim = memslice.memview.view.ndim
17027  *
17028  */
17029 
17030  /* function exit code */
17031  __pyx_L1_error:;
17032  {
17033  #ifdef WITH_THREAD
17034  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17035  #endif
17036  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17037  #ifdef WITH_THREAD
17038  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17039  #endif
17040  }
17041  __pyx_r = 0;
17042  __pyx_L0:;
17043  return __pyx_r;
17044 }
17045 
17046 /* "View.MemoryView":971
17047  * cdef int (*to_dtype_func)(char *, object) except 0
17048  *
17049  * def __dealloc__(self): # <<<<<<<<<<<<<<
17050  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17051  *
17052  */
17053 
17054 /* Python wrapper */
17055 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
17056 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17057  __Pyx_RefNannyDeclarations
17058  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
17059  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17060 
17061  /* function exit code */
17062  __Pyx_RefNannyFinishContext();
17063 }
17064 
17065 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17066  __Pyx_RefNannyDeclarations
17067  __Pyx_RefNannySetupContext("__dealloc__", 0);
17068 
17069  /* "View.MemoryView":972
17070  *
17071  * def __dealloc__(self):
17072  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
17073  *
17074  * cdef convert_item_to_object(self, char *itemp):
17075  */
17076  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17077 
17078  /* "View.MemoryView":971
17079  * cdef int (*to_dtype_func)(char *, object) except 0
17080  *
17081  * def __dealloc__(self): # <<<<<<<<<<<<<<
17082  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17083  *
17084  */
17085 
17086  /* function exit code */
17087  __Pyx_RefNannyFinishContext();
17088 }
17089 
17090 /* "View.MemoryView":974
17091  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17092  *
17093  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17094  * if self.to_object_func != NULL:
17095  * return self.to_object_func(itemp)
17096  */
17097 
17098 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
17099  PyObject *__pyx_r = NULL;
17100  __Pyx_RefNannyDeclarations
17101  int __pyx_t_1;
17102  PyObject *__pyx_t_2 = NULL;
17103  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
17104 
17105  /* "View.MemoryView":975
17106  *
17107  * cdef convert_item_to_object(self, char *itemp):
17108  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17109  * return self.to_object_func(itemp)
17110  * else:
17111  */
17112  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17113  if (__pyx_t_1) {
17114 
17115  /* "View.MemoryView":976
17116  * cdef convert_item_to_object(self, char *itemp):
17117  * if self.to_object_func != NULL:
17118  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
17119  * else:
17120  * return memoryview.convert_item_to_object(self, itemp)
17121  */
17122  __Pyx_XDECREF(__pyx_r);
17123  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 976, __pyx_L1_error)
17124  __Pyx_GOTREF(__pyx_t_2);
17125  __pyx_r = __pyx_t_2;
17126  __pyx_t_2 = 0;
17127  goto __pyx_L0;
17128 
17129  /* "View.MemoryView":975
17130  *
17131  * cdef convert_item_to_object(self, char *itemp):
17132  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17133  * return self.to_object_func(itemp)
17134  * else:
17135  */
17136  }
17137 
17138  /* "View.MemoryView":978
17139  * return self.to_object_func(itemp)
17140  * else:
17141  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
17142  *
17143  * cdef assign_item_from_object(self, char *itemp, object value):
17144  */
17145  /*else*/ {
17146  __Pyx_XDECREF(__pyx_r);
17147  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 978, __pyx_L1_error)
17148  __Pyx_GOTREF(__pyx_t_2);
17149  __pyx_r = __pyx_t_2;
17150  __pyx_t_2 = 0;
17151  goto __pyx_L0;
17152  }
17153 
17154  /* "View.MemoryView":974
17155  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17156  *
17157  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17158  * if self.to_object_func != NULL:
17159  * return self.to_object_func(itemp)
17160  */
17161 
17162  /* function exit code */
17163  __pyx_L1_error:;
17164  __Pyx_XDECREF(__pyx_t_2);
17165  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17166  __pyx_r = 0;
17167  __pyx_L0:;
17168  __Pyx_XGIVEREF(__pyx_r);
17169  __Pyx_RefNannyFinishContext();
17170  return __pyx_r;
17171 }
17172 
17173 /* "View.MemoryView":980
17174  * return memoryview.convert_item_to_object(self, itemp)
17175  *
17176  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17177  * if self.to_dtype_func != NULL:
17178  * self.to_dtype_func(itemp, value)
17179  */
17180 
17181 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17182  PyObject *__pyx_r = NULL;
17183  __Pyx_RefNannyDeclarations
17184  int __pyx_t_1;
17185  int __pyx_t_2;
17186  PyObject *__pyx_t_3 = NULL;
17187  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
17188 
17189  /* "View.MemoryView":981
17190  *
17191  * cdef assign_item_from_object(self, char *itemp, object value):
17192  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17193  * self.to_dtype_func(itemp, value)
17194  * else:
17195  */
17196  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17197  if (__pyx_t_1) {
17198 
17199  /* "View.MemoryView":982
17200  * cdef assign_item_from_object(self, char *itemp, object value):
17201  * if self.to_dtype_func != NULL:
17202  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
17203  * else:
17204  * memoryview.assign_item_from_object(self, itemp, value)
17205  */
17206  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 982, __pyx_L1_error)
17207 
17208  /* "View.MemoryView":981
17209  *
17210  * cdef assign_item_from_object(self, char *itemp, object value):
17211  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17212  * self.to_dtype_func(itemp, value)
17213  * else:
17214  */
17215  goto __pyx_L3;
17216  }
17217 
17218  /* "View.MemoryView":984
17219  * self.to_dtype_func(itemp, value)
17220  * else:
17221  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
17222  *
17223  * @property
17224  */
17225  /*else*/ {
17226  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 984, __pyx_L1_error)
17227  __Pyx_GOTREF(__pyx_t_3);
17228  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17229  }
17230  __pyx_L3:;
17231 
17232  /* "View.MemoryView":980
17233  * return memoryview.convert_item_to_object(self, itemp)
17234  *
17235  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17236  * if self.to_dtype_func != NULL:
17237  * self.to_dtype_func(itemp, value)
17238  */
17239 
17240  /* function exit code */
17241  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17242  goto __pyx_L0;
17243  __pyx_L1_error:;
17244  __Pyx_XDECREF(__pyx_t_3);
17245  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17246  __pyx_r = 0;
17247  __pyx_L0:;
17248  __Pyx_XGIVEREF(__pyx_r);
17249  __Pyx_RefNannyFinishContext();
17250  return __pyx_r;
17251 }
17252 
17253 /* "View.MemoryView":987
17254  *
17255  * @property
17256  * def base(self): # <<<<<<<<<<<<<<
17257  * return self.from_object
17258  *
17259  */
17260 
17261 /* Python wrapper */
17262 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
17263 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17264  PyObject *__pyx_r = 0;
17265  __Pyx_RefNannyDeclarations
17266  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17267  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17268 
17269  /* function exit code */
17270  __Pyx_RefNannyFinishContext();
17271  return __pyx_r;
17272 }
17273 
17274 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17275  PyObject *__pyx_r = NULL;
17276  __Pyx_RefNannyDeclarations
17277  __Pyx_RefNannySetupContext("__get__", 0);
17278 
17279  /* "View.MemoryView":988
17280  * @property
17281  * def base(self):
17282  * return self.from_object # <<<<<<<<<<<<<<
17283  *
17284  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
17285  */
17286  __Pyx_XDECREF(__pyx_r);
17287  __Pyx_INCREF(__pyx_v_self->from_object);
17288  __pyx_r = __pyx_v_self->from_object;
17289  goto __pyx_L0;
17290 
17291  /* "View.MemoryView":987
17292  *
17293  * @property
17294  * def base(self): # <<<<<<<<<<<<<<
17295  * return self.from_object
17296  *
17297  */
17298 
17299  /* function exit code */
17300  __pyx_L0:;
17301  __Pyx_XGIVEREF(__pyx_r);
17302  __Pyx_RefNannyFinishContext();
17303  return __pyx_r;
17304 }
17305 
17306 /* "(tree fragment)":1
17307  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17308  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17309  * def __setstate_cython__(self, __pyx_state):
17310  */
17311 
17312 /* Python wrapper */
17313 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17314 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
17315 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17316  PyObject *__pyx_r = 0;
17317  __Pyx_RefNannyDeclarations
17318  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17319  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17320 
17321  /* function exit code */
17322  __Pyx_RefNannyFinishContext();
17323  return __pyx_r;
17324 }
17325 
17326 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17327  PyObject *__pyx_r = NULL;
17328  __Pyx_RefNannyDeclarations
17329  PyObject *__pyx_t_1 = NULL;
17330  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17331 
17332  /* "(tree fragment)":2
17333  * def __reduce_cython__(self):
17334  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17335  * def __setstate_cython__(self, __pyx_state):
17336  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17337  */
17338  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17339  __Pyx_GOTREF(__pyx_t_1);
17340  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17341  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17342  __PYX_ERR(1, 2, __pyx_L1_error)
17343 
17344  /* "(tree fragment)":1
17345  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17346  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17347  * def __setstate_cython__(self, __pyx_state):
17348  */
17349 
17350  /* function exit code */
17351  __pyx_L1_error:;
17352  __Pyx_XDECREF(__pyx_t_1);
17353  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17354  __pyx_r = NULL;
17355  __Pyx_XGIVEREF(__pyx_r);
17356  __Pyx_RefNannyFinishContext();
17357  return __pyx_r;
17358 }
17359 
17360 /* "(tree fragment)":3
17361  * def __reduce_cython__(self):
17362  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17363  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17364  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17365  */
17366 
17367 /* Python wrapper */
17368 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
17369 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
17370 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17371  PyObject *__pyx_r = 0;
17372  __Pyx_RefNannyDeclarations
17373  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17374  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17375 
17376  /* function exit code */
17377  __Pyx_RefNannyFinishContext();
17378  return __pyx_r;
17379 }
17380 
17381 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17382  PyObject *__pyx_r = NULL;
17383  __Pyx_RefNannyDeclarations
17384  PyObject *__pyx_t_1 = NULL;
17385  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17386 
17387  /* "(tree fragment)":4
17388  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17389  * def __setstate_cython__(self, __pyx_state):
17390  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17391  */
17392  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17393  __Pyx_GOTREF(__pyx_t_1);
17394  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17395  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17396  __PYX_ERR(1, 4, __pyx_L1_error)
17397 
17398  /* "(tree fragment)":3
17399  * def __reduce_cython__(self):
17400  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17401  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17402  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17403  */
17404 
17405  /* function exit code */
17406  __pyx_L1_error:;
17407  __Pyx_XDECREF(__pyx_t_1);
17408  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17409  __pyx_r = NULL;
17410  __Pyx_XGIVEREF(__pyx_r);
17411  __Pyx_RefNannyFinishContext();
17412  return __pyx_r;
17413 }
17414 
17415 /* "View.MemoryView":994
17416  *
17417  * @cname('__pyx_memoryview_fromslice')
17418  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17419  * int ndim,
17420  * object (*to_object_func)(char *),
17421  */
17422 
17423 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
17424  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17425  Py_ssize_t __pyx_v_suboffset;
17426  PyObject *__pyx_v_length = NULL;
17427  PyObject *__pyx_r = NULL;
17428  __Pyx_RefNannyDeclarations
17429  int __pyx_t_1;
17430  PyObject *__pyx_t_2 = NULL;
17431  PyObject *__pyx_t_3 = NULL;
17432  __Pyx_TypeInfo *__pyx_t_4;
17433  Py_buffer __pyx_t_5;
17434  Py_ssize_t *__pyx_t_6;
17435  Py_ssize_t *__pyx_t_7;
17436  Py_ssize_t *__pyx_t_8;
17437  Py_ssize_t __pyx_t_9;
17438  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17439 
17440  /* "View.MemoryView":1002
17441  * cdef _memoryviewslice result
17442  *
17443  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17444  * return None
17445  *
17446  */
17447  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17448  if (__pyx_t_1) {
17449 
17450  /* "View.MemoryView":1003
17451  *
17452  * if <PyObject *> memviewslice.memview == Py_None:
17453  * return None # <<<<<<<<<<<<<<
17454  *
17455  *
17456  */
17457  __Pyx_XDECREF(__pyx_r);
17458  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17459  goto __pyx_L0;
17460 
17461  /* "View.MemoryView":1002
17462  * cdef _memoryviewslice result
17463  *
17464  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17465  * return None
17466  *
17467  */
17468  }
17469 
17470  /* "View.MemoryView":1008
17471  *
17472  *
17473  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17474  *
17475  * result.from_slice = memviewslice
17476  */
17477  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1008, __pyx_L1_error)
17478  __Pyx_GOTREF(__pyx_t_2);
17479  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1008, __pyx_L1_error)
17480  __Pyx_GOTREF(__pyx_t_3);
17481  __Pyx_INCREF(Py_None);
17482  __Pyx_GIVEREF(Py_None);
17483  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17484  __Pyx_INCREF(__pyx_int_0);
17485  __Pyx_GIVEREF(__pyx_int_0);
17486  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17487  __Pyx_GIVEREF(__pyx_t_2);
17488  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17489  __pyx_t_2 = 0;
17490  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1008, __pyx_L1_error)
17491  __Pyx_GOTREF(__pyx_t_2);
17492  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17493  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17494  __pyx_t_2 = 0;
17495 
17496  /* "View.MemoryView":1010
17497  * result = _memoryviewslice(None, 0, dtype_is_object)
17498  *
17499  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
17500  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17501  *
17502  */
17503  __pyx_v_result->from_slice = __pyx_v_memviewslice;
17504 
17505  /* "View.MemoryView":1011
17506  *
17507  * result.from_slice = memviewslice
17508  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
17509  *
17510  * result.from_object = (<memoryview> memviewslice.memview).base
17511  */
17512  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17513 
17514  /* "View.MemoryView":1013
17515  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17516  *
17517  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
17518  * result.typeinfo = memviewslice.memview.typeinfo
17519  *
17520  */
17521  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17522  __Pyx_GOTREF(__pyx_t_2);
17523  __Pyx_GIVEREF(__pyx_t_2);
17524  __Pyx_GOTREF(__pyx_v_result->from_object);
17525  __Pyx_DECREF(__pyx_v_result->from_object);
17526  __pyx_v_result->from_object = __pyx_t_2;
17527  __pyx_t_2 = 0;
17528 
17529  /* "View.MemoryView":1014
17530  *
17531  * result.from_object = (<memoryview> memviewslice.memview).base
17532  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
17533  *
17534  * result.view = memviewslice.memview.view
17535  */
17536  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17537  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17538 
17539  /* "View.MemoryView":1016
17540  * result.typeinfo = memviewslice.memview.typeinfo
17541  *
17542  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
17543  * result.view.buf = <void *> memviewslice.data
17544  * result.view.ndim = ndim
17545  */
17546  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17547  __pyx_v_result->__pyx_base.view = __pyx_t_5;
17548 
17549  /* "View.MemoryView":1017
17550  *
17551  * result.view = memviewslice.memview.view
17552  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
17553  * result.view.ndim = ndim
17554  * (<__pyx_buffer *> &result.view).obj = Py_None
17555  */
17556  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17557 
17558  /* "View.MemoryView":1018
17559  * result.view = memviewslice.memview.view
17560  * result.view.buf = <void *> memviewslice.data
17561  * result.view.ndim = ndim # <<<<<<<<<<<<<<
17562  * (<__pyx_buffer *> &result.view).obj = Py_None
17563  * Py_INCREF(Py_None)
17564  */
17565  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17566 
17567  /* "View.MemoryView":1019
17568  * result.view.buf = <void *> memviewslice.data
17569  * result.view.ndim = ndim
17570  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
17571  * Py_INCREF(Py_None)
17572  *
17573  */
17574  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17575 
17576  /* "View.MemoryView":1020
17577  * result.view.ndim = ndim
17578  * (<__pyx_buffer *> &result.view).obj = Py_None
17579  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
17580  *
17581  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17582  */
17583  Py_INCREF(Py_None);
17584 
17585  /* "View.MemoryView":1022
17586  * Py_INCREF(Py_None)
17587  *
17588  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17589  * result.flags = PyBUF_RECORDS
17590  * else:
17591  */
17592  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17593  if (__pyx_t_1) {
17594 
17595  /* "View.MemoryView":1023
17596  *
17597  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17598  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
17599  * else:
17600  * result.flags = PyBUF_RECORDS_RO
17601  */
17602  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17603 
17604  /* "View.MemoryView":1022
17605  * Py_INCREF(Py_None)
17606  *
17607  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17608  * result.flags = PyBUF_RECORDS
17609  * else:
17610  */
17611  goto __pyx_L4;
17612  }
17613 
17614  /* "View.MemoryView":1025
17615  * result.flags = PyBUF_RECORDS
17616  * else:
17617  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
17618  *
17619  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17620  */
17621  /*else*/ {
17622  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17623  }
17624  __pyx_L4:;
17625 
17626  /* "View.MemoryView":1027
17627  * result.flags = PyBUF_RECORDS_RO
17628  *
17629  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
17630  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
17631  *
17632  */
17633  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17634 
17635  /* "View.MemoryView":1028
17636  *
17637  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17638  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
17639  *
17640  *
17641  */
17642  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17643 
17644  /* "View.MemoryView":1031
17645  *
17646  *
17647  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
17648  * for suboffset in result.from_slice.suboffsets[:ndim]:
17649  * if suboffset >= 0:
17650  */
17651  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17652 
17653  /* "View.MemoryView":1032
17654  *
17655  * result.view.suboffsets = NULL
17656  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
17657  * if suboffset >= 0:
17658  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17659  */
17660  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17661  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17662  __pyx_t_6 = __pyx_t_8;
17663  __pyx_v_suboffset = (__pyx_t_6[0]);
17664 
17665  /* "View.MemoryView":1033
17666  * result.view.suboffsets = NULL
17667  * for suboffset in result.from_slice.suboffsets[:ndim]:
17668  * if suboffset >= 0: # <<<<<<<<<<<<<<
17669  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17670  * break
17671  */
17672  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17673  if (__pyx_t_1) {
17674 
17675  /* "View.MemoryView":1034
17676  * for suboffset in result.from_slice.suboffsets[:ndim]:
17677  * if suboffset >= 0:
17678  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
17679  * break
17680  *
17681  */
17682  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17683 
17684  /* "View.MemoryView":1035
17685  * if suboffset >= 0:
17686  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17687  * break # <<<<<<<<<<<<<<
17688  *
17689  * result.view.len = result.view.itemsize
17690  */
17691  goto __pyx_L6_break;
17692 
17693  /* "View.MemoryView":1033
17694  * result.view.suboffsets = NULL
17695  * for suboffset in result.from_slice.suboffsets[:ndim]:
17696  * if suboffset >= 0: # <<<<<<<<<<<<<<
17697  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17698  * break
17699  */
17700  }
17701  }
17702  __pyx_L6_break:;
17703 
17704  /* "View.MemoryView":1037
17705  * break
17706  *
17707  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
17708  * for length in result.view.shape[:ndim]:
17709  * result.view.len *= length
17710  */
17711  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17712  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17713 
17714  /* "View.MemoryView":1038
17715  *
17716  * result.view.len = result.view.itemsize
17717  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
17718  * result.view.len *= length
17719  *
17720  */
17721  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17722  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17723  __pyx_t_6 = __pyx_t_8;
17724  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1038, __pyx_L1_error)
17725  __Pyx_GOTREF(__pyx_t_2);
17726  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17727  __pyx_t_2 = 0;
17728 
17729  /* "View.MemoryView":1039
17730  * result.view.len = result.view.itemsize
17731  * for length in result.view.shape[:ndim]:
17732  * result.view.len *= length # <<<<<<<<<<<<<<
17733  *
17734  * result.to_object_func = to_object_func
17735  */
17736  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1039, __pyx_L1_error)
17737  __Pyx_GOTREF(__pyx_t_2);
17738  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1039, __pyx_L1_error)
17739  __Pyx_GOTREF(__pyx_t_3);
17740  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17741  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1039, __pyx_L1_error)
17742  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17743  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17744  }
17745 
17746  /* "View.MemoryView":1041
17747  * result.view.len *= length
17748  *
17749  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
17750  * result.to_dtype_func = to_dtype_func
17751  *
17752  */
17753  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17754 
17755  /* "View.MemoryView":1042
17756  *
17757  * result.to_object_func = to_object_func
17758  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
17759  *
17760  * return result
17761  */
17762  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17763 
17764  /* "View.MemoryView":1044
17765  * result.to_dtype_func = to_dtype_func
17766  *
17767  * return result # <<<<<<<<<<<<<<
17768  *
17769  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17770  */
17771  __Pyx_XDECREF(__pyx_r);
17772  __Pyx_INCREF(((PyObject *)__pyx_v_result));
17773  __pyx_r = ((PyObject *)__pyx_v_result);
17774  goto __pyx_L0;
17775 
17776  /* "View.MemoryView":994
17777  *
17778  * @cname('__pyx_memoryview_fromslice')
17779  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17780  * int ndim,
17781  * object (*to_object_func)(char *),
17782  */
17783 
17784  /* function exit code */
17785  __pyx_L1_error:;
17786  __Pyx_XDECREF(__pyx_t_2);
17787  __Pyx_XDECREF(__pyx_t_3);
17788  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17789  __pyx_r = 0;
17790  __pyx_L0:;
17791  __Pyx_XDECREF((PyObject *)__pyx_v_result);
17792  __Pyx_XDECREF(__pyx_v_length);
17793  __Pyx_XGIVEREF(__pyx_r);
17794  __Pyx_RefNannyFinishContext();
17795  return __pyx_r;
17796 }
17797 
17798 /* "View.MemoryView":1047
17799  *
17800  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17801  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17802  * __Pyx_memviewslice *mslice):
17803  * cdef _memoryviewslice obj
17804  */
17805 
17806 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17807  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17808  __Pyx_memviewslice *__pyx_r;
17809  __Pyx_RefNannyDeclarations
17810  int __pyx_t_1;
17811  int __pyx_t_2;
17812  PyObject *__pyx_t_3 = NULL;
17813  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
17814 
17815  /* "View.MemoryView":1050
17816  * __Pyx_memviewslice *mslice):
17817  * cdef _memoryviewslice obj
17818  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17819  * obj = memview
17820  * return &obj.from_slice
17821  */
17822  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17823  __pyx_t_2 = (__pyx_t_1 != 0);
17824  if (__pyx_t_2) {
17825 
17826  /* "View.MemoryView":1051
17827  * cdef _memoryviewslice obj
17828  * if isinstance(memview, _memoryviewslice):
17829  * obj = memview # <<<<<<<<<<<<<<
17830  * return &obj.from_slice
17831  * else:
17832  */
17833  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1051, __pyx_L1_error)
17834  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17835  __Pyx_INCREF(__pyx_t_3);
17836  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17837  __pyx_t_3 = 0;
17838 
17839  /* "View.MemoryView":1052
17840  * if isinstance(memview, _memoryviewslice):
17841  * obj = memview
17842  * return &obj.from_slice # <<<<<<<<<<<<<<
17843  * else:
17844  * slice_copy(memview, mslice)
17845  */
17846  __pyx_r = (&__pyx_v_obj->from_slice);
17847  goto __pyx_L0;
17848 
17849  /* "View.MemoryView":1050
17850  * __Pyx_memviewslice *mslice):
17851  * cdef _memoryviewslice obj
17852  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17853  * obj = memview
17854  * return &obj.from_slice
17855  */
17856  }
17857 
17858  /* "View.MemoryView":1054
17859  * return &obj.from_slice
17860  * else:
17861  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
17862  * return mslice
17863  *
17864  */
17865  /*else*/ {
17866  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17867 
17868  /* "View.MemoryView":1055
17869  * else:
17870  * slice_copy(memview, mslice)
17871  * return mslice # <<<<<<<<<<<<<<
17872  *
17873  * @cname('__pyx_memoryview_slice_copy')
17874  */
17875  __pyx_r = __pyx_v_mslice;
17876  goto __pyx_L0;
17877  }
17878 
17879  /* "View.MemoryView":1047
17880  *
17881  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17882  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17883  * __Pyx_memviewslice *mslice):
17884  * cdef _memoryviewslice obj
17885  */
17886 
17887  /* function exit code */
17888  __pyx_L1_error:;
17889  __Pyx_XDECREF(__pyx_t_3);
17890  __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17891  __pyx_r = 0;
17892  __pyx_L0:;
17893  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17894  __Pyx_RefNannyFinishContext();
17895  return __pyx_r;
17896 }
17897 
17898 /* "View.MemoryView":1058
17899  *
17900  * @cname('__pyx_memoryview_slice_copy')
17901  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17902  * cdef int dim
17903  * cdef (Py_ssize_t*) shape, strides, suboffsets
17904  */
17905 
17906 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17907  int __pyx_v_dim;
17908  Py_ssize_t *__pyx_v_shape;
17909  Py_ssize_t *__pyx_v_strides;
17910  Py_ssize_t *__pyx_v_suboffsets;
17911  __Pyx_RefNannyDeclarations
17912  Py_ssize_t *__pyx_t_1;
17913  int __pyx_t_2;
17914  int __pyx_t_3;
17915  int __pyx_t_4;
17916  Py_ssize_t __pyx_t_5;
17917  __Pyx_RefNannySetupContext("slice_copy", 0);
17918 
17919  /* "View.MemoryView":1062
17920  * cdef (Py_ssize_t*) shape, strides, suboffsets
17921  *
17922  * shape = memview.view.shape # <<<<<<<<<<<<<<
17923  * strides = memview.view.strides
17924  * suboffsets = memview.view.suboffsets
17925  */
17926  __pyx_t_1 = __pyx_v_memview->view.shape;
17927  __pyx_v_shape = __pyx_t_1;
17928 
17929  /* "View.MemoryView":1063
17930  *
17931  * shape = memview.view.shape
17932  * strides = memview.view.strides # <<<<<<<<<<<<<<
17933  * suboffsets = memview.view.suboffsets
17934  *
17935  */
17936  __pyx_t_1 = __pyx_v_memview->view.strides;
17937  __pyx_v_strides = __pyx_t_1;
17938 
17939  /* "View.MemoryView":1064
17940  * shape = memview.view.shape
17941  * strides = memview.view.strides
17942  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
17943  *
17944  * dst.memview = <__pyx_memoryview *> memview
17945  */
17946  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17947  __pyx_v_suboffsets = __pyx_t_1;
17948 
17949  /* "View.MemoryView":1066
17950  * suboffsets = memview.view.suboffsets
17951  *
17952  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
17953  * dst.data = <char *> memview.view.buf
17954  *
17955  */
17956  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
17957 
17958  /* "View.MemoryView":1067
17959  *
17960  * dst.memview = <__pyx_memoryview *> memview
17961  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
17962  *
17963  * for dim in range(memview.view.ndim):
17964  */
17965  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
17966 
17967  /* "View.MemoryView":1069
17968  * dst.data = <char *> memview.view.buf
17969  *
17970  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
17971  * dst.shape[dim] = shape[dim]
17972  * dst.strides[dim] = strides[dim]
17973  */
17974  __pyx_t_2 = __pyx_v_memview->view.ndim;
17975  __pyx_t_3 = __pyx_t_2;
17976  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17977  __pyx_v_dim = __pyx_t_4;
17978 
17979  /* "View.MemoryView":1070
17980  *
17981  * for dim in range(memview.view.ndim):
17982  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
17983  * dst.strides[dim] = strides[dim]
17984  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17985  */
17986  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17987 
17988  /* "View.MemoryView":1071
17989  * for dim in range(memview.view.ndim):
17990  * dst.shape[dim] = shape[dim]
17991  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
17992  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17993  *
17994  */
17995  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17996 
17997  /* "View.MemoryView":1072
17998  * dst.shape[dim] = shape[dim]
17999  * dst.strides[dim] = strides[dim]
18000  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
18001  *
18002  * @cname('__pyx_memoryview_copy_object')
18003  */
18004  if ((__pyx_v_suboffsets != 0)) {
18005  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18006  } else {
18007  __pyx_t_5 = -1L;
18008  }
18009  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18010  }
18011 
18012  /* "View.MemoryView":1058
18013  *
18014  * @cname('__pyx_memoryview_slice_copy')
18015  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18016  * cdef int dim
18017  * cdef (Py_ssize_t*) shape, strides, suboffsets
18018  */
18019 
18020  /* function exit code */
18021  __Pyx_RefNannyFinishContext();
18022 }
18023 
18024 /* "View.MemoryView":1075
18025  *
18026  * @cname('__pyx_memoryview_copy_object')
18027  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18028  * "Create a new memoryview object"
18029  * cdef __Pyx_memviewslice memviewslice
18030  */
18031 
18032 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
18033  __Pyx_memviewslice __pyx_v_memviewslice;
18034  PyObject *__pyx_r = NULL;
18035  __Pyx_RefNannyDeclarations
18036  PyObject *__pyx_t_1 = NULL;
18037  __Pyx_RefNannySetupContext("memoryview_copy", 0);
18038 
18039  /* "View.MemoryView":1078
18040  * "Create a new memoryview object"
18041  * cdef __Pyx_memviewslice memviewslice
18042  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
18043  * return memoryview_copy_from_slice(memview, &memviewslice)
18044  *
18045  */
18046  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18047 
18048  /* "View.MemoryView":1079
18049  * cdef __Pyx_memviewslice memviewslice
18050  * slice_copy(memview, &memviewslice)
18051  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
18052  *
18053  * @cname('__pyx_memoryview_copy_object_from_slice')
18054  */
18055  __Pyx_XDECREF(__pyx_r);
18056  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1079, __pyx_L1_error)
18057  __Pyx_GOTREF(__pyx_t_1);
18058  __pyx_r = __pyx_t_1;
18059  __pyx_t_1 = 0;
18060  goto __pyx_L0;
18061 
18062  /* "View.MemoryView":1075
18063  *
18064  * @cname('__pyx_memoryview_copy_object')
18065  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18066  * "Create a new memoryview object"
18067  * cdef __Pyx_memviewslice memviewslice
18068  */
18069 
18070  /* function exit code */
18071  __pyx_L1_error:;
18072  __Pyx_XDECREF(__pyx_t_1);
18073  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18074  __pyx_r = 0;
18075  __pyx_L0:;
18076  __Pyx_XGIVEREF(__pyx_r);
18077  __Pyx_RefNannyFinishContext();
18078  return __pyx_r;
18079 }
18080 
18081 /* "View.MemoryView":1082
18082  *
18083  * @cname('__pyx_memoryview_copy_object_from_slice')
18084  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18085  * """
18086  * Create a new memoryview object from a given memoryview object and slice.
18087  */
18088 
18089 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18090  PyObject *(*__pyx_v_to_object_func)(char *);
18091  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
18092  PyObject *__pyx_r = NULL;
18093  __Pyx_RefNannyDeclarations
18094  int __pyx_t_1;
18095  int __pyx_t_2;
18096  PyObject *(*__pyx_t_3)(char *);
18097  int (*__pyx_t_4)(char *, PyObject *);
18098  PyObject *__pyx_t_5 = NULL;
18099  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
18100 
18101  /* "View.MemoryView":1089
18102  * cdef int (*to_dtype_func)(char *, object) except 0
18103  *
18104  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18105  * to_object_func = (<_memoryviewslice> memview).to_object_func
18106  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18107  */
18108  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18109  __pyx_t_2 = (__pyx_t_1 != 0);
18110  if (__pyx_t_2) {
18111 
18112  /* "View.MemoryView":1090
18113  *
18114  * if isinstance(memview, _memoryviewslice):
18115  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
18116  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18117  * else:
18118  */
18119  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18120  __pyx_v_to_object_func = __pyx_t_3;
18121 
18122  /* "View.MemoryView":1091
18123  * if isinstance(memview, _memoryviewslice):
18124  * to_object_func = (<_memoryviewslice> memview).to_object_func
18125  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
18126  * else:
18127  * to_object_func = NULL
18128  */
18129  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18130  __pyx_v_to_dtype_func = __pyx_t_4;
18131 
18132  /* "View.MemoryView":1089
18133  * cdef int (*to_dtype_func)(char *, object) except 0
18134  *
18135  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18136  * to_object_func = (<_memoryviewslice> memview).to_object_func
18137  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18138  */
18139  goto __pyx_L3;
18140  }
18141 
18142  /* "View.MemoryView":1093
18143  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18144  * else:
18145  * to_object_func = NULL # <<<<<<<<<<<<<<
18146  * to_dtype_func = NULL
18147  *
18148  */
18149  /*else*/ {
18150  __pyx_v_to_object_func = NULL;
18151 
18152  /* "View.MemoryView":1094
18153  * else:
18154  * to_object_func = NULL
18155  * to_dtype_func = NULL # <<<<<<<<<<<<<<
18156  *
18157  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18158  */
18159  __pyx_v_to_dtype_func = NULL;
18160  }
18161  __pyx_L3:;
18162 
18163  /* "View.MemoryView":1096
18164  * to_dtype_func = NULL
18165  *
18166  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
18167  * to_object_func, to_dtype_func,
18168  * memview.dtype_is_object)
18169  */
18170  __Pyx_XDECREF(__pyx_r);
18171 
18172  /* "View.MemoryView":1098
18173  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18174  * to_object_func, to_dtype_func,
18175  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18176  *
18177  *
18178  */
18179  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1096, __pyx_L1_error)
18180  __Pyx_GOTREF(__pyx_t_5);
18181  __pyx_r = __pyx_t_5;
18182  __pyx_t_5 = 0;
18183  goto __pyx_L0;
18184 
18185  /* "View.MemoryView":1082
18186  *
18187  * @cname('__pyx_memoryview_copy_object_from_slice')
18188  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18189  * """
18190  * Create a new memoryview object from a given memoryview object and slice.
18191  */
18192 
18193  /* function exit code */
18194  __pyx_L1_error:;
18195  __Pyx_XDECREF(__pyx_t_5);
18196  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18197  __pyx_r = 0;
18198  __pyx_L0:;
18199  __Pyx_XGIVEREF(__pyx_r);
18200  __Pyx_RefNannyFinishContext();
18201  return __pyx_r;
18202 }
18203 
18204 /* "View.MemoryView":1104
18205  *
18206  *
18207  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18208  * if arg < 0:
18209  * return -arg
18210  */
18211 
18212 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18213  Py_ssize_t __pyx_r;
18214  int __pyx_t_1;
18215 
18216  /* "View.MemoryView":1105
18217  *
18218  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18219  * if arg < 0: # <<<<<<<<<<<<<<
18220  * return -arg
18221  * else:
18222  */
18223  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18224  if (__pyx_t_1) {
18225 
18226  /* "View.MemoryView":1106
18227  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18228  * if arg < 0:
18229  * return -arg # <<<<<<<<<<<<<<
18230  * else:
18231  * return arg
18232  */
18233  __pyx_r = (-__pyx_v_arg);
18234  goto __pyx_L0;
18235 
18236  /* "View.MemoryView":1105
18237  *
18238  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18239  * if arg < 0: # <<<<<<<<<<<<<<
18240  * return -arg
18241  * else:
18242  */
18243  }
18244 
18245  /* "View.MemoryView":1108
18246  * return -arg
18247  * else:
18248  * return arg # <<<<<<<<<<<<<<
18249  *
18250  * @cname('__pyx_get_best_slice_order')
18251  */
18252  /*else*/ {
18253  __pyx_r = __pyx_v_arg;
18254  goto __pyx_L0;
18255  }
18256 
18257  /* "View.MemoryView":1104
18258  *
18259  *
18260  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18261  * if arg < 0:
18262  * return -arg
18263  */
18264 
18265  /* function exit code */
18266  __pyx_L0:;
18267  return __pyx_r;
18268 }
18269 
18270 /* "View.MemoryView":1111
18271  *
18272  * @cname('__pyx_get_best_slice_order')
18273  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18274  * """
18275  * Figure out the best memory access order for a given slice.
18276  */
18277 
18278 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
18279  int __pyx_v_i;
18280  Py_ssize_t __pyx_v_c_stride;
18281  Py_ssize_t __pyx_v_f_stride;
18282  char __pyx_r;
18283  int __pyx_t_1;
18284  int __pyx_t_2;
18285  int __pyx_t_3;
18286  int __pyx_t_4;
18287 
18288  /* "View.MemoryView":1116
18289  * """
18290  * cdef int i
18291  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
18292  * cdef Py_ssize_t f_stride = 0
18293  *
18294  */
18295  __pyx_v_c_stride = 0;
18296 
18297  /* "View.MemoryView":1117
18298  * cdef int i
18299  * cdef Py_ssize_t c_stride = 0
18300  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18301  *
18302  * for i in range(ndim - 1, -1, -1):
18303  */
18304  __pyx_v_f_stride = 0;
18305 
18306  /* "View.MemoryView":1119
18307  * cdef Py_ssize_t f_stride = 0
18308  *
18309  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18310  * if mslice.shape[i] > 1:
18311  * c_stride = mslice.strides[i]
18312  */
18313  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18314  __pyx_v_i = __pyx_t_1;
18315 
18316  /* "View.MemoryView":1120
18317  *
18318  * for i in range(ndim - 1, -1, -1):
18319  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18320  * c_stride = mslice.strides[i]
18321  * break
18322  */
18323  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18324  if (__pyx_t_2) {
18325 
18326  /* "View.MemoryView":1121
18327  * for i in range(ndim - 1, -1, -1):
18328  * if mslice.shape[i] > 1:
18329  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18330  * break
18331  *
18332  */
18333  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18334 
18335  /* "View.MemoryView":1122
18336  * if mslice.shape[i] > 1:
18337  * c_stride = mslice.strides[i]
18338  * break # <<<<<<<<<<<<<<
18339  *
18340  * for i in range(ndim):
18341  */
18342  goto __pyx_L4_break;
18343 
18344  /* "View.MemoryView":1120
18345  *
18346  * for i in range(ndim - 1, -1, -1):
18347  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18348  * c_stride = mslice.strides[i]
18349  * break
18350  */
18351  }
18352  }
18353  __pyx_L4_break:;
18354 
18355  /* "View.MemoryView":1124
18356  * break
18357  *
18358  * for i in range(ndim): # <<<<<<<<<<<<<<
18359  * if mslice.shape[i] > 1:
18360  * f_stride = mslice.strides[i]
18361  */
18362  __pyx_t_1 = __pyx_v_ndim;
18363  __pyx_t_3 = __pyx_t_1;
18364  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18365  __pyx_v_i = __pyx_t_4;
18366 
18367  /* "View.MemoryView":1125
18368  *
18369  * for i in range(ndim):
18370  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18371  * f_stride = mslice.strides[i]
18372  * break
18373  */
18374  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18375  if (__pyx_t_2) {
18376 
18377  /* "View.MemoryView":1126
18378  * for i in range(ndim):
18379  * if mslice.shape[i] > 1:
18380  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18381  * break
18382  *
18383  */
18384  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18385 
18386  /* "View.MemoryView":1127
18387  * if mslice.shape[i] > 1:
18388  * f_stride = mslice.strides[i]
18389  * break # <<<<<<<<<<<<<<
18390  *
18391  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18392  */
18393  goto __pyx_L7_break;
18394 
18395  /* "View.MemoryView":1125
18396  *
18397  * for i in range(ndim):
18398  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18399  * f_stride = mslice.strides[i]
18400  * break
18401  */
18402  }
18403  }
18404  __pyx_L7_break:;
18405 
18406  /* "View.MemoryView":1129
18407  * break
18408  *
18409  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18410  * return 'C'
18411  * else:
18412  */
18413  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18414  if (__pyx_t_2) {
18415 
18416  /* "View.MemoryView":1130
18417  *
18418  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18419  * return 'C' # <<<<<<<<<<<<<<
18420  * else:
18421  * return 'F'
18422  */
18423  __pyx_r = 'C';
18424  goto __pyx_L0;
18425 
18426  /* "View.MemoryView":1129
18427  * break
18428  *
18429  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18430  * return 'C'
18431  * else:
18432  */
18433  }
18434 
18435  /* "View.MemoryView":1132
18436  * return 'C'
18437  * else:
18438  * return 'F' # <<<<<<<<<<<<<<
18439  *
18440  * @cython.cdivision(True)
18441  */
18442  /*else*/ {
18443  __pyx_r = 'F';
18444  goto __pyx_L0;
18445  }
18446 
18447  /* "View.MemoryView":1111
18448  *
18449  * @cname('__pyx_get_best_slice_order')
18450  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18451  * """
18452  * Figure out the best memory access order for a given slice.
18453  */
18454 
18455  /* function exit code */
18456  __pyx_L0:;
18457  return __pyx_r;
18458 }
18459 
18460 /* "View.MemoryView":1135
18461  *
18462  * @cython.cdivision(True)
18463  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18464  * char *dst_data, Py_ssize_t *dst_strides,
18465  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18466  */
18467 
18468 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18469  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18470  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18471  Py_ssize_t __pyx_v_dst_extent;
18472  Py_ssize_t __pyx_v_src_stride;
18473  Py_ssize_t __pyx_v_dst_stride;
18474  int __pyx_t_1;
18475  int __pyx_t_2;
18476  int __pyx_t_3;
18477  Py_ssize_t __pyx_t_4;
18478  Py_ssize_t __pyx_t_5;
18479  Py_ssize_t __pyx_t_6;
18480 
18481  /* "View.MemoryView":1142
18482  *
18483  * cdef Py_ssize_t i
18484  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
18485  * cdef Py_ssize_t dst_extent = dst_shape[0]
18486  * cdef Py_ssize_t src_stride = src_strides[0]
18487  */
18488  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18489 
18490  /* "View.MemoryView":1143
18491  * cdef Py_ssize_t i
18492  * cdef Py_ssize_t src_extent = src_shape[0]
18493  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
18494  * cdef Py_ssize_t src_stride = src_strides[0]
18495  * cdef Py_ssize_t dst_stride = dst_strides[0]
18496  */
18497  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18498 
18499  /* "View.MemoryView":1144
18500  * cdef Py_ssize_t src_extent = src_shape[0]
18501  * cdef Py_ssize_t dst_extent = dst_shape[0]
18502  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
18503  * cdef Py_ssize_t dst_stride = dst_strides[0]
18504  *
18505  */
18506  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18507 
18508  /* "View.MemoryView":1145
18509  * cdef Py_ssize_t dst_extent = dst_shape[0]
18510  * cdef Py_ssize_t src_stride = src_strides[0]
18511  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
18512  *
18513  * if ndim == 1:
18514  */
18515  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18516 
18517  /* "View.MemoryView":1147
18518  * cdef Py_ssize_t dst_stride = dst_strides[0]
18519  *
18520  * if ndim == 1: # <<<<<<<<<<<<<<
18521  * if (src_stride > 0 and dst_stride > 0 and
18522  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18523  */
18524  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18525  if (__pyx_t_1) {
18526 
18527  /* "View.MemoryView":1148
18528  *
18529  * if ndim == 1:
18530  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18531  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18532  * memcpy(dst_data, src_data, itemsize * dst_extent)
18533  */
18534  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18535  if (__pyx_t_2) {
18536  } else {
18537  __pyx_t_1 = __pyx_t_2;
18538  goto __pyx_L5_bool_binop_done;
18539  }
18540  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18541  if (__pyx_t_2) {
18542  } else {
18543  __pyx_t_1 = __pyx_t_2;
18544  goto __pyx_L5_bool_binop_done;
18545  }
18546 
18547  /* "View.MemoryView":1149
18548  * if ndim == 1:
18549  * if (src_stride > 0 and dst_stride > 0 and
18550  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
18551  * memcpy(dst_data, src_data, itemsize * dst_extent)
18552  * else:
18553  */
18554  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18555  if (__pyx_t_2) {
18556  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18557  }
18558  __pyx_t_3 = (__pyx_t_2 != 0);
18559  __pyx_t_1 = __pyx_t_3;
18560  __pyx_L5_bool_binop_done:;
18561 
18562  /* "View.MemoryView":1148
18563  *
18564  * if ndim == 1:
18565  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18566  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18567  * memcpy(dst_data, src_data, itemsize * dst_extent)
18568  */
18569  if (__pyx_t_1) {
18570 
18571  /* "View.MemoryView":1150
18572  * if (src_stride > 0 and dst_stride > 0 and
18573  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18574  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
18575  * else:
18576  * for i in range(dst_extent):
18577  */
18578  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18579 
18580  /* "View.MemoryView":1148
18581  *
18582  * if ndim == 1:
18583  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18584  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18585  * memcpy(dst_data, src_data, itemsize * dst_extent)
18586  */
18587  goto __pyx_L4;
18588  }
18589 
18590  /* "View.MemoryView":1152
18591  * memcpy(dst_data, src_data, itemsize * dst_extent)
18592  * else:
18593  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18594  * memcpy(dst_data, src_data, itemsize)
18595  * src_data += src_stride
18596  */
18597  /*else*/ {
18598  __pyx_t_4 = __pyx_v_dst_extent;
18599  __pyx_t_5 = __pyx_t_4;
18600  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18601  __pyx_v_i = __pyx_t_6;
18602 
18603  /* "View.MemoryView":1153
18604  * else:
18605  * for i in range(dst_extent):
18606  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
18607  * src_data += src_stride
18608  * dst_data += dst_stride
18609  */
18610  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18611 
18612  /* "View.MemoryView":1154
18613  * for i in range(dst_extent):
18614  * memcpy(dst_data, src_data, itemsize)
18615  * src_data += src_stride # <<<<<<<<<<<<<<
18616  * dst_data += dst_stride
18617  * else:
18618  */
18619  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18620 
18621  /* "View.MemoryView":1155
18622  * memcpy(dst_data, src_data, itemsize)
18623  * src_data += src_stride
18624  * dst_data += dst_stride # <<<<<<<<<<<<<<
18625  * else:
18626  * for i in range(dst_extent):
18627  */
18628  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18629  }
18630  }
18631  __pyx_L4:;
18632 
18633  /* "View.MemoryView":1147
18634  * cdef Py_ssize_t dst_stride = dst_strides[0]
18635  *
18636  * if ndim == 1: # <<<<<<<<<<<<<<
18637  * if (src_stride > 0 and dst_stride > 0 and
18638  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18639  */
18640  goto __pyx_L3;
18641  }
18642 
18643  /* "View.MemoryView":1157
18644  * dst_data += dst_stride
18645  * else:
18646  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18647  * _copy_strided_to_strided(src_data, src_strides + 1,
18648  * dst_data, dst_strides + 1,
18649  */
18650  /*else*/ {
18651  __pyx_t_4 = __pyx_v_dst_extent;
18652  __pyx_t_5 = __pyx_t_4;
18653  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18654  __pyx_v_i = __pyx_t_6;
18655 
18656  /* "View.MemoryView":1158
18657  * else:
18658  * for i in range(dst_extent):
18659  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
18660  * dst_data, dst_strides + 1,
18661  * src_shape + 1, dst_shape + 1,
18662  */
18663  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18664 
18665  /* "View.MemoryView":1162
18666  * src_shape + 1, dst_shape + 1,
18667  * ndim - 1, itemsize)
18668  * src_data += src_stride # <<<<<<<<<<<<<<
18669  * dst_data += dst_stride
18670  *
18671  */
18672  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18673 
18674  /* "View.MemoryView":1163
18675  * ndim - 1, itemsize)
18676  * src_data += src_stride
18677  * dst_data += dst_stride # <<<<<<<<<<<<<<
18678  *
18679  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
18680  */
18681  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18682  }
18683  }
18684  __pyx_L3:;
18685 
18686  /* "View.MemoryView":1135
18687  *
18688  * @cython.cdivision(True)
18689  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18690  * char *dst_data, Py_ssize_t *dst_strides,
18691  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18692  */
18693 
18694  /* function exit code */
18695 }
18696 
18697 /* "View.MemoryView":1165
18698  * dst_data += dst_stride
18699  *
18700  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18701  * __Pyx_memviewslice *dst,
18702  * int ndim, size_t itemsize) nogil:
18703  */
18704 
18705 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18706 
18707  /* "View.MemoryView":1168
18708  * __Pyx_memviewslice *dst,
18709  * int ndim, size_t itemsize) nogil:
18710  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
18711  * src.shape, dst.shape, ndim, itemsize)
18712  *
18713  */
18714  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18715 
18716  /* "View.MemoryView":1165
18717  * dst_data += dst_stride
18718  *
18719  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18720  * __Pyx_memviewslice *dst,
18721  * int ndim, size_t itemsize) nogil:
18722  */
18723 
18724  /* function exit code */
18725 }
18726 
18727 /* "View.MemoryView":1172
18728  *
18729  * @cname('__pyx_memoryview_slice_get_size')
18730  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18731  * "Return the size of the memory occupied by the slice in number of bytes"
18732  * cdef int i
18733  */
18734 
18735 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
18736  int __pyx_v_i;
18737  Py_ssize_t __pyx_v_size;
18738  Py_ssize_t __pyx_r;
18739  Py_ssize_t __pyx_t_1;
18740  int __pyx_t_2;
18741  int __pyx_t_3;
18742  int __pyx_t_4;
18743 
18744  /* "View.MemoryView":1175
18745  * "Return the size of the memory occupied by the slice in number of bytes"
18746  * cdef int i
18747  * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<<
18748  *
18749  * for i in range(ndim):
18750  */
18751  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18752  __pyx_v_size = __pyx_t_1;
18753 
18754  /* "View.MemoryView":1177
18755  * cdef Py_ssize_t size = src.memview.view.itemsize
18756  *
18757  * for i in range(ndim): # <<<<<<<<<<<<<<
18758  * size *= src.shape[i]
18759  *
18760  */
18761  __pyx_t_2 = __pyx_v_ndim;
18762  __pyx_t_3 = __pyx_t_2;
18763  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18764  __pyx_v_i = __pyx_t_4;
18765 
18766  /* "View.MemoryView":1178
18767  *
18768  * for i in range(ndim):
18769  * size *= src.shape[i] # <<<<<<<<<<<<<<
18770  *
18771  * return size
18772  */
18773  __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
18774  }
18775 
18776  /* "View.MemoryView":1180
18777  * size *= src.shape[i]
18778  *
18779  * return size # <<<<<<<<<<<<<<
18780  *
18781  * @cname('__pyx_fill_contig_strides_array')
18782  */
18783  __pyx_r = __pyx_v_size;
18784  goto __pyx_L0;
18785 
18786  /* "View.MemoryView":1172
18787  *
18788  * @cname('__pyx_memoryview_slice_get_size')
18789  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18790  * "Return the size of the memory occupied by the slice in number of bytes"
18791  * cdef int i
18792  */
18793 
18794  /* function exit code */
18795  __pyx_L0:;
18796  return __pyx_r;
18797 }
18798 
18799 /* "View.MemoryView":1183
18800  *
18801  * @cname('__pyx_fill_contig_strides_array')
18802  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18803  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18804  * int ndim, char order) nogil:
18805  */
18806 
18807 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
18808  int __pyx_v_idx;
18809  Py_ssize_t __pyx_r;
18810  int __pyx_t_1;
18811  int __pyx_t_2;
18812  int __pyx_t_3;
18813  int __pyx_t_4;
18814 
18815  /* "View.MemoryView":1192
18816  * cdef int idx
18817  *
18818  * if order == 'F': # <<<<<<<<<<<<<<
18819  * for idx in range(ndim):
18820  * strides[idx] = stride
18821  */
18822  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
18823  if (__pyx_t_1) {
18824 
18825  /* "View.MemoryView":1193
18826  *
18827  * if order == 'F':
18828  * for idx in range(ndim): # <<<<<<<<<<<<<<
18829  * strides[idx] = stride
18830  * stride = stride * shape[idx]
18831  */
18832  __pyx_t_2 = __pyx_v_ndim;
18833  __pyx_t_3 = __pyx_t_2;
18834  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18835  __pyx_v_idx = __pyx_t_4;
18836 
18837  /* "View.MemoryView":1194
18838  * if order == 'F':
18839  * for idx in range(ndim):
18840  * strides[idx] = stride # <<<<<<<<<<<<<<
18841  * stride = stride * shape[idx]
18842  * else:
18843  */
18844  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18845 
18846  /* "View.MemoryView":1195
18847  * for idx in range(ndim):
18848  * strides[idx] = stride
18849  * stride = stride * shape[idx] # <<<<<<<<<<<<<<
18850  * else:
18851  * for idx in range(ndim - 1, -1, -1):
18852  */
18853  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18854  }
18855 
18856  /* "View.MemoryView":1192
18857  * cdef int idx
18858  *
18859  * if order == 'F': # <<<<<<<<<<<<<<
18860  * for idx in range(ndim):
18861  * strides[idx] = stride
18862  */
18863  goto __pyx_L3;
18864  }
18865 
18866  /* "View.MemoryView":1197
18867  * stride = stride * shape[idx]
18868  * else:
18869  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18870  * strides[idx] = stride
18871  * stride = stride * shape[idx]
18872  */
18873  /*else*/ {
18874  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18875  __pyx_v_idx = __pyx_t_2;
18876 
18877  /* "View.MemoryView":1198
18878  * else:
18879  * for idx in range(ndim - 1, -1, -1):
18880  * strides[idx] = stride # <<<<<<<<<<<<<<
18881  * stride = stride * shape[idx]
18882  *
18883  */
18884  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18885 
18886  /* "View.MemoryView":1199
18887  * for idx in range(ndim - 1, -1, -1):
18888  * strides[idx] = stride
18889  * stride = stride * shape[idx] # <<<<<<<<<<<<<<
18890  *
18891  * return stride
18892  */
18893  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18894  }
18895  }
18896  __pyx_L3:;
18897 
18898  /* "View.MemoryView":1201
18899  * stride = stride * shape[idx]
18900  *
18901  * return stride # <<<<<<<<<<<<<<
18902  *
18903  * @cname('__pyx_memoryview_copy_data_to_temp')
18904  */
18905  __pyx_r = __pyx_v_stride;
18906  goto __pyx_L0;
18907 
18908  /* "View.MemoryView":1183
18909  *
18910  * @cname('__pyx_fill_contig_strides_array')
18911  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18912  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18913  * int ndim, char order) nogil:
18914  */
18915 
18916  /* function exit code */
18917  __pyx_L0:;
18918  return __pyx_r;
18919 }
18920 
18921 /* "View.MemoryView":1204
18922  *
18923  * @cname('__pyx_memoryview_copy_data_to_temp')
18924  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18925  * __Pyx_memviewslice *tmpslice,
18926  * char order,
18927  */
18928 
18929 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
18930  int __pyx_v_i;
18931  void *__pyx_v_result;
18932  size_t __pyx_v_itemsize;
18933  size_t __pyx_v_size;
18934  void *__pyx_r;
18935  Py_ssize_t __pyx_t_1;
18936  int __pyx_t_2;
18937  int __pyx_t_3;
18938  struct __pyx_memoryview_obj *__pyx_t_4;
18939  int __pyx_t_5;
18940  int __pyx_t_6;
18941 
18942  /* "View.MemoryView":1215
18943  * cdef void *result
18944  *
18945  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
18946  * cdef size_t size = slice_get_size(src, ndim)
18947  *
18948  */
18949  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18950  __pyx_v_itemsize = __pyx_t_1;
18951 
18952  /* "View.MemoryView":1216
18953  *
18954  * cdef size_t itemsize = src.memview.view.itemsize
18955  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
18956  *
18957  * result = malloc(size)
18958  */
18959  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18960 
18961  /* "View.MemoryView":1218
18962  * cdef size_t size = slice_get_size(src, ndim)
18963  *
18964  * result = malloc(size) # <<<<<<<<<<<<<<
18965  * if not result:
18966  * _err(MemoryError, NULL)
18967  */
18968  __pyx_v_result = malloc(__pyx_v_size);
18969 
18970  /* "View.MemoryView":1219
18971  *
18972  * result = malloc(size)
18973  * if not result: # <<<<<<<<<<<<<<
18974  * _err(MemoryError, NULL)
18975  *
18976  */
18977  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18978  if (__pyx_t_2) {
18979 
18980  /* "View.MemoryView":1220
18981  * result = malloc(size)
18982  * if not result:
18983  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
18984  *
18985  *
18986  */
18987  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1220, __pyx_L1_error)
18988 
18989  /* "View.MemoryView":1219
18990  *
18991  * result = malloc(size)
18992  * if not result: # <<<<<<<<<<<<<<
18993  * _err(MemoryError, NULL)
18994  *
18995  */
18996  }
18997 
18998  /* "View.MemoryView":1223
18999  *
19000  *
19001  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19002  * tmpslice.memview = src.memview
19003  * for i in range(ndim):
19004  */
19005  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19006 
19007  /* "View.MemoryView":1224
19008  *
19009  * tmpslice.data = <char *> result
19010  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19011  * for i in range(ndim):
19012  * tmpslice.shape[i] = src.shape[i]
19013  */
19014  __pyx_t_4 = __pyx_v_src->memview;
19015  __pyx_v_tmpslice->memview = __pyx_t_4;
19016 
19017  /* "View.MemoryView":1225
19018  * tmpslice.data = <char *> result
19019  * tmpslice.memview = src.memview
19020  * for i in range(ndim): # <<<<<<<<<<<<<<
19021  * tmpslice.shape[i] = src.shape[i]
19022  * tmpslice.suboffsets[i] = -1
19023  */
19024  __pyx_t_3 = __pyx_v_ndim;
19025  __pyx_t_5 = __pyx_t_3;
19026  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19027  __pyx_v_i = __pyx_t_6;
19028 
19029  /* "View.MemoryView":1226
19030  * tmpslice.memview = src.memview
19031  * for i in range(ndim):
19032  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
19033  * tmpslice.suboffsets[i] = -1
19034  *
19035  */
19036  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19037 
19038  /* "View.MemoryView":1227
19039  * for i in range(ndim):
19040  * tmpslice.shape[i] = src.shape[i]
19041  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19042  *
19043  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
19044  */
19045  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19046  }
19047 
19048  /* "View.MemoryView":1229
19049  * tmpslice.suboffsets[i] = -1
19050  *
19051  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
19052  * ndim, order)
19053  *
19054  */
19055  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19056 
19057  /* "View.MemoryView":1233
19058  *
19059  *
19060  * for i in range(ndim): # <<<<<<<<<<<<<<
19061  * if tmpslice.shape[i] == 1:
19062  * tmpslice.strides[i] = 0
19063  */
19064  __pyx_t_3 = __pyx_v_ndim;
19065  __pyx_t_5 = __pyx_t_3;
19066  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19067  __pyx_v_i = __pyx_t_6;
19068 
19069  /* "View.MemoryView":1234
19070  *
19071  * for i in range(ndim):
19072  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19073  * tmpslice.strides[i] = 0
19074  *
19075  */
19076  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19077  if (__pyx_t_2) {
19078 
19079  /* "View.MemoryView":1235
19080  * for i in range(ndim):
19081  * if tmpslice.shape[i] == 1:
19082  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19083  *
19084  * if slice_is_contig(src[0], order, ndim):
19085  */
19086  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19087 
19088  /* "View.MemoryView":1234
19089  *
19090  * for i in range(ndim):
19091  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19092  * tmpslice.strides[i] = 0
19093  *
19094  */
19095  }
19096  }
19097 
19098  /* "View.MemoryView":1237
19099  * tmpslice.strides[i] = 0
19100  *
19101  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19102  * memcpy(result, src.data, size)
19103  * else:
19104  */
19105  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19106  if (__pyx_t_2) {
19107 
19108  /* "View.MemoryView":1238
19109  *
19110  * if slice_is_contig(src[0], order, ndim):
19111  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19112  * else:
19113  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19114  */
19115  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19116 
19117  /* "View.MemoryView":1237
19118  * tmpslice.strides[i] = 0
19119  *
19120  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19121  * memcpy(result, src.data, size)
19122  * else:
19123  */
19124  goto __pyx_L9;
19125  }
19126 
19127  /* "View.MemoryView":1240
19128  * memcpy(result, src.data, size)
19129  * else:
19130  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
19131  *
19132  * return result
19133  */
19134  /*else*/ {
19135  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19136  }
19137  __pyx_L9:;
19138 
19139  /* "View.MemoryView":1242
19140  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19141  *
19142  * return result # <<<<<<<<<<<<<<
19143  *
19144  *
19145  */
19146  __pyx_r = __pyx_v_result;
19147  goto __pyx_L0;
19148 
19149  /* "View.MemoryView":1204
19150  *
19151  * @cname('__pyx_memoryview_copy_data_to_temp')
19152  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19153  * __Pyx_memviewslice *tmpslice,
19154  * char order,
19155  */
19156 
19157  /* function exit code */
19158  __pyx_L1_error:;
19159  {
19160  #ifdef WITH_THREAD
19161  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19162  #endif
19163  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19164  #ifdef WITH_THREAD
19165  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19166  #endif
19167  }
19168  __pyx_r = NULL;
19169  __pyx_L0:;
19170  return __pyx_r;
19171 }
19172 
19173 /* "View.MemoryView":1247
19174  *
19175  * @cname('__pyx_memoryview_err_extents')
19176  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19177  * Py_ssize_t extent2) except -1 with gil:
19178  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19179  */
19180 
19181 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19182  int __pyx_r;
19183  __Pyx_RefNannyDeclarations
19184  PyObject *__pyx_t_1 = NULL;
19185  PyObject *__pyx_t_2 = NULL;
19186  PyObject *__pyx_t_3 = NULL;
19187  PyObject *__pyx_t_4 = NULL;
19188  #ifdef WITH_THREAD
19189  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19190  #endif
19191  __Pyx_RefNannySetupContext("_err_extents", 0);
19192 
19193  /* "View.MemoryView":1250
19194  * Py_ssize_t extent2) except -1 with gil:
19195  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19196  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
19197  *
19198  * @cname('__pyx_memoryview_err_dim')
19199  */
19200  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1250, __pyx_L1_error)
19201  __Pyx_GOTREF(__pyx_t_1);
19202  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1250, __pyx_L1_error)
19203  __Pyx_GOTREF(__pyx_t_2);
19204  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1250, __pyx_L1_error)
19205  __Pyx_GOTREF(__pyx_t_3);
19206  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1250, __pyx_L1_error)
19207  __Pyx_GOTREF(__pyx_t_4);
19208  __Pyx_GIVEREF(__pyx_t_1);
19209  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19210  __Pyx_GIVEREF(__pyx_t_2);
19211  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19212  __Pyx_GIVEREF(__pyx_t_3);
19213  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19214  __pyx_t_1 = 0;
19215  __pyx_t_2 = 0;
19216  __pyx_t_3 = 0;
19217 
19218  /* "View.MemoryView":1249
19219  * cdef int _err_extents(int i, Py_ssize_t extent1,
19220  * Py_ssize_t extent2) except -1 with gil:
19221  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
19222  * (i, extent1, extent2))
19223  *
19224  */
19225  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1249, __pyx_L1_error)
19226  __Pyx_GOTREF(__pyx_t_3);
19227  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19228  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
19229  __Pyx_GOTREF(__pyx_t_4);
19230  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19231  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19232  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19233  __PYX_ERR(1, 1249, __pyx_L1_error)
19234 
19235  /* "View.MemoryView":1247
19236  *
19237  * @cname('__pyx_memoryview_err_extents')
19238  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19239  * Py_ssize_t extent2) except -1 with gil:
19240  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19241  */
19242 
19243  /* function exit code */
19244  __pyx_L1_error:;
19245  __Pyx_XDECREF(__pyx_t_1);
19246  __Pyx_XDECREF(__pyx_t_2);
19247  __Pyx_XDECREF(__pyx_t_3);
19248  __Pyx_XDECREF(__pyx_t_4);
19249  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19250  __pyx_r = -1;
19251  __Pyx_RefNannyFinishContext();
19252  #ifdef WITH_THREAD
19253  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19254  #endif
19255  return __pyx_r;
19256 }
19257 
19258 /* "View.MemoryView":1253
19259  *
19260  * @cname('__pyx_memoryview_err_dim')
19261  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19262  * raise error(msg.decode('ascii') % dim)
19263  *
19264  */
19265 
19266 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
19267  int __pyx_r;
19268  __Pyx_RefNannyDeclarations
19269  PyObject *__pyx_t_1 = NULL;
19270  PyObject *__pyx_t_2 = NULL;
19271  PyObject *__pyx_t_3 = NULL;
19272  PyObject *__pyx_t_4 = NULL;
19273  PyObject *__pyx_t_5 = NULL;
19274  #ifdef WITH_THREAD
19275  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19276  #endif
19277  __Pyx_RefNannySetupContext("_err_dim", 0);
19278  __Pyx_INCREF(__pyx_v_error);
19279 
19280  /* "View.MemoryView":1254
19281  * @cname('__pyx_memoryview_err_dim')
19282  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19283  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19284  *
19285  * @cname('__pyx_memoryview_err')
19286  */
19287  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19288  __Pyx_GOTREF(__pyx_t_2);
19289  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19290  __Pyx_GOTREF(__pyx_t_3);
19291  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19292  __Pyx_GOTREF(__pyx_t_4);
19293  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19294  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19295  __Pyx_INCREF(__pyx_v_error);
19296  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19297  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19298  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19299  if (likely(__pyx_t_2)) {
19300  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19301  __Pyx_INCREF(__pyx_t_2);
19302  __Pyx_INCREF(function);
19303  __Pyx_DECREF_SET(__pyx_t_3, function);
19304  }
19305  }
19306  if (!__pyx_t_2) {
19307  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19308  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19309  __Pyx_GOTREF(__pyx_t_1);
19310  } else {
19311  #if CYTHON_FAST_PYCALL
19312  if (PyFunction_Check(__pyx_t_3)) {
19313  PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
19314  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19315  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19316  __Pyx_GOTREF(__pyx_t_1);
19317  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19318  } else
19319  #endif
19320  #if CYTHON_FAST_PYCCALL
19321  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
19322  PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
19323  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19324  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19325  __Pyx_GOTREF(__pyx_t_1);
19326  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19327  } else
19328  #endif
19329  {
19330  __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1254, __pyx_L1_error)
19331  __Pyx_GOTREF(__pyx_t_5);
19332  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
19333  __Pyx_GIVEREF(__pyx_t_4);
19334  PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
19335  __pyx_t_4 = 0;
19336  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19337  __Pyx_GOTREF(__pyx_t_1);
19338  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19339  }
19340  }
19341  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19342  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19343  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19344  __PYX_ERR(1, 1254, __pyx_L1_error)
19345 
19346  /* "View.MemoryView":1253
19347  *
19348  * @cname('__pyx_memoryview_err_dim')
19349  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19350  * raise error(msg.decode('ascii') % dim)
19351  *
19352  */
19353 
19354  /* function exit code */
19355  __pyx_L1_error:;
19356  __Pyx_XDECREF(__pyx_t_1);
19357  __Pyx_XDECREF(__pyx_t_2);
19358  __Pyx_XDECREF(__pyx_t_3);
19359  __Pyx_XDECREF(__pyx_t_4);
19360  __Pyx_XDECREF(__pyx_t_5);
19361  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19362  __pyx_r = -1;
19363  __Pyx_XDECREF(__pyx_v_error);
19364  __Pyx_RefNannyFinishContext();
19365  #ifdef WITH_THREAD
19366  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19367  #endif
19368  return __pyx_r;
19369 }
19370 
19371 /* "View.MemoryView":1257
19372  *
19373  * @cname('__pyx_memoryview_err')
19374  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19375  * if msg != NULL:
19376  * raise error(msg.decode('ascii'))
19377  */
19378 
19379 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19380  int __pyx_r;
19381  __Pyx_RefNannyDeclarations
19382  int __pyx_t_1;
19383  PyObject *__pyx_t_2 = NULL;
19384  PyObject *__pyx_t_3 = NULL;
19385  PyObject *__pyx_t_4 = NULL;
19386  PyObject *__pyx_t_5 = NULL;
19387  PyObject *__pyx_t_6 = NULL;
19388  #ifdef WITH_THREAD
19389  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19390  #endif
19391  __Pyx_RefNannySetupContext("_err", 0);
19392  __Pyx_INCREF(__pyx_v_error);
19393 
19394  /* "View.MemoryView":1258
19395  * @cname('__pyx_memoryview_err')
19396  * cdef int _err(object error, char *msg) except -1 with gil:
19397  * if msg != NULL: # <<<<<<<<<<<<<<
19398  * raise error(msg.decode('ascii'))
19399  * else:
19400  */
19401  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19402  if (unlikely(__pyx_t_1)) {
19403 
19404  /* "View.MemoryView":1259
19405  * cdef int _err(object error, char *msg) except -1 with gil:
19406  * if msg != NULL:
19407  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19408  * else:
19409  * raise error
19410  */
19411  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1259, __pyx_L1_error)
19412  __Pyx_GOTREF(__pyx_t_3);
19413  __Pyx_INCREF(__pyx_v_error);
19414  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19415  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19416  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19417  if (likely(__pyx_t_5)) {
19418  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19419  __Pyx_INCREF(__pyx_t_5);
19420  __Pyx_INCREF(function);
19421  __Pyx_DECREF_SET(__pyx_t_4, function);
19422  }
19423  }
19424  if (!__pyx_t_5) {
19425  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19426  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19427  __Pyx_GOTREF(__pyx_t_2);
19428  } else {
19429  #if CYTHON_FAST_PYCALL
19430  if (PyFunction_Check(__pyx_t_4)) {
19431  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
19432  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19433  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19434  __Pyx_GOTREF(__pyx_t_2);
19435  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19436  } else
19437  #endif
19438  #if CYTHON_FAST_PYCCALL
19439  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
19440  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
19441  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19442  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19443  __Pyx_GOTREF(__pyx_t_2);
19444  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19445  } else
19446  #endif
19447  {
19448  __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1259, __pyx_L1_error)
19449  __Pyx_GOTREF(__pyx_t_6);
19450  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
19451  __Pyx_GIVEREF(__pyx_t_3);
19452  PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
19453  __pyx_t_3 = 0;
19454  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19455  __Pyx_GOTREF(__pyx_t_2);
19456  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19457  }
19458  }
19459  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19460  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19461  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19462  __PYX_ERR(1, 1259, __pyx_L1_error)
19463 
19464  /* "View.MemoryView":1258
19465  * @cname('__pyx_memoryview_err')
19466  * cdef int _err(object error, char *msg) except -1 with gil:
19467  * if msg != NULL: # <<<<<<<<<<<<<<
19468  * raise error(msg.decode('ascii'))
19469  * else:
19470  */
19471  }
19472 
19473  /* "View.MemoryView":1261
19474  * raise error(msg.decode('ascii'))
19475  * else:
19476  * raise error # <<<<<<<<<<<<<<
19477  *
19478  * @cname('__pyx_memoryview_copy_contents')
19479  */
19480  /*else*/ {
19481  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19482  __PYX_ERR(1, 1261, __pyx_L1_error)
19483  }
19484 
19485  /* "View.MemoryView":1257
19486  *
19487  * @cname('__pyx_memoryview_err')
19488  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19489  * if msg != NULL:
19490  * raise error(msg.decode('ascii'))
19491  */
19492 
19493  /* function exit code */
19494  __pyx_L1_error:;
19495  __Pyx_XDECREF(__pyx_t_2);
19496  __Pyx_XDECREF(__pyx_t_3);
19497  __Pyx_XDECREF(__pyx_t_4);
19498  __Pyx_XDECREF(__pyx_t_5);
19499  __Pyx_XDECREF(__pyx_t_6);
19500  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19501  __pyx_r = -1;
19502  __Pyx_XDECREF(__pyx_v_error);
19503  __Pyx_RefNannyFinishContext();
19504  #ifdef WITH_THREAD
19505  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19506  #endif
19507  return __pyx_r;
19508 }
19509 
19510 /* "View.MemoryView":1264
19511  *
19512  * @cname('__pyx_memoryview_copy_contents')
19513  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19514  * __Pyx_memviewslice dst,
19515  * int src_ndim, int dst_ndim,
19516  */
19517 
19518 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
19519  void *__pyx_v_tmpdata;
19520  size_t __pyx_v_itemsize;
19521  int __pyx_v_i;
19522  char __pyx_v_order;
19523  int __pyx_v_broadcasting;
19524  int __pyx_v_direct_copy;
19525  __Pyx_memviewslice __pyx_v_tmp;
19526  int __pyx_v_ndim;
19527  int __pyx_r;
19528  Py_ssize_t __pyx_t_1;
19529  int __pyx_t_2;
19530  int __pyx_t_3;
19531  int __pyx_t_4;
19532  int __pyx_t_5;
19533  int __pyx_t_6;
19534  void *__pyx_t_7;
19535  int __pyx_t_8;
19536 
19537  /* "View.MemoryView":1272
19538  * Check for overlapping memory and verify the shapes.
19539  * """
19540  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
19541  * cdef size_t itemsize = src.memview.view.itemsize
19542  * cdef int i
19543  */
19544  __pyx_v_tmpdata = NULL;
19545 
19546  /* "View.MemoryView":1273
19547  * """
19548  * cdef void *tmpdata = NULL
19549  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19550  * cdef int i
19551  * cdef char order = get_best_order(&src, src_ndim)
19552  */
19553  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19554  __pyx_v_itemsize = __pyx_t_1;
19555 
19556  /* "View.MemoryView":1275
19557  * cdef size_t itemsize = src.memview.view.itemsize
19558  * cdef int i
19559  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
19560  * cdef bint broadcasting = False
19561  * cdef bint direct_copy = False
19562  */
19563  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19564 
19565  /* "View.MemoryView":1276
19566  * cdef int i
19567  * cdef char order = get_best_order(&src, src_ndim)
19568  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
19569  * cdef bint direct_copy = False
19570  * cdef __Pyx_memviewslice tmp
19571  */
19572  __pyx_v_broadcasting = 0;
19573 
19574  /* "View.MemoryView":1277
19575  * cdef char order = get_best_order(&src, src_ndim)
19576  * cdef bint broadcasting = False
19577  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
19578  * cdef __Pyx_memviewslice tmp
19579  *
19580  */
19581  __pyx_v_direct_copy = 0;
19582 
19583  /* "View.MemoryView":1280
19584  * cdef __Pyx_memviewslice tmp
19585  *
19586  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19587  * broadcast_leading(&src, src_ndim, dst_ndim)
19588  * elif dst_ndim < src_ndim:
19589  */
19590  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19591  if (__pyx_t_2) {
19592 
19593  /* "View.MemoryView":1281
19594  *
19595  * if src_ndim < dst_ndim:
19596  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19597  * elif dst_ndim < src_ndim:
19598  * broadcast_leading(&dst, dst_ndim, src_ndim)
19599  */
19600  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19601 
19602  /* "View.MemoryView":1280
19603  * cdef __Pyx_memviewslice tmp
19604  *
19605  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19606  * broadcast_leading(&src, src_ndim, dst_ndim)
19607  * elif dst_ndim < src_ndim:
19608  */
19609  goto __pyx_L3;
19610  }
19611 
19612  /* "View.MemoryView":1282
19613  * if src_ndim < dst_ndim:
19614  * broadcast_leading(&src, src_ndim, dst_ndim)
19615  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19616  * broadcast_leading(&dst, dst_ndim, src_ndim)
19617  *
19618  */
19619  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19620  if (__pyx_t_2) {
19621 
19622  /* "View.MemoryView":1283
19623  * broadcast_leading(&src, src_ndim, dst_ndim)
19624  * elif dst_ndim < src_ndim:
19625  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
19626  *
19627  * cdef int ndim = max(src_ndim, dst_ndim)
19628  */
19629  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19630 
19631  /* "View.MemoryView":1282
19632  * if src_ndim < dst_ndim:
19633  * broadcast_leading(&src, src_ndim, dst_ndim)
19634  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19635  * broadcast_leading(&dst, dst_ndim, src_ndim)
19636  *
19637  */
19638  }
19639  __pyx_L3:;
19640 
19641  /* "View.MemoryView":1285
19642  * broadcast_leading(&dst, dst_ndim, src_ndim)
19643  *
19644  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19645  *
19646  * for i in range(ndim):
19647  */
19648  __pyx_t_3 = __pyx_v_dst_ndim;
19649  __pyx_t_4 = __pyx_v_src_ndim;
19650  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19651  __pyx_t_5 = __pyx_t_3;
19652  } else {
19653  __pyx_t_5 = __pyx_t_4;
19654  }
19655  __pyx_v_ndim = __pyx_t_5;
19656 
19657  /* "View.MemoryView":1287
19658  * cdef int ndim = max(src_ndim, dst_ndim)
19659  *
19660  * for i in range(ndim): # <<<<<<<<<<<<<<
19661  * if src.shape[i] != dst.shape[i]:
19662  * if src.shape[i] == 1:
19663  */
19664  __pyx_t_5 = __pyx_v_ndim;
19665  __pyx_t_3 = __pyx_t_5;
19666  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19667  __pyx_v_i = __pyx_t_4;
19668 
19669  /* "View.MemoryView":1288
19670  *
19671  * for i in range(ndim):
19672  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19673  * if src.shape[i] == 1:
19674  * broadcasting = True
19675  */
19676  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19677  if (__pyx_t_2) {
19678 
19679  /* "View.MemoryView":1289
19680  * for i in range(ndim):
19681  * if src.shape[i] != dst.shape[i]:
19682  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19683  * broadcasting = True
19684  * src.strides[i] = 0
19685  */
19686  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19687  if (__pyx_t_2) {
19688 
19689  /* "View.MemoryView":1290
19690  * if src.shape[i] != dst.shape[i]:
19691  * if src.shape[i] == 1:
19692  * broadcasting = True # <<<<<<<<<<<<<<
19693  * src.strides[i] = 0
19694  * else:
19695  */
19696  __pyx_v_broadcasting = 1;
19697 
19698  /* "View.MemoryView":1291
19699  * if src.shape[i] == 1:
19700  * broadcasting = True
19701  * src.strides[i] = 0 # <<<<<<<<<<<<<<
19702  * else:
19703  * _err_extents(i, dst.shape[i], src.shape[i])
19704  */
19705  (__pyx_v_src.strides[__pyx_v_i]) = 0;
19706 
19707  /* "View.MemoryView":1289
19708  * for i in range(ndim):
19709  * if src.shape[i] != dst.shape[i]:
19710  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19711  * broadcasting = True
19712  * src.strides[i] = 0
19713  */
19714  goto __pyx_L7;
19715  }
19716 
19717  /* "View.MemoryView":1293
19718  * src.strides[i] = 0
19719  * else:
19720  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
19721  *
19722  * if src.suboffsets[i] >= 0:
19723  */
19724  /*else*/ {
19725  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1293, __pyx_L1_error)
19726  }
19727  __pyx_L7:;
19728 
19729  /* "View.MemoryView":1288
19730  *
19731  * for i in range(ndim):
19732  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19733  * if src.shape[i] == 1:
19734  * broadcasting = True
19735  */
19736  }
19737 
19738  /* "View.MemoryView":1295
19739  * _err_extents(i, dst.shape[i], src.shape[i])
19740  *
19741  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19742  * _err_dim(ValueError, "Dimension %d is not direct", i)
19743  *
19744  */
19745  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19746  if (__pyx_t_2) {
19747 
19748  /* "View.MemoryView":1296
19749  *
19750  * if src.suboffsets[i] >= 0:
19751  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
19752  *
19753  * if slices_overlap(&src, &dst, ndim, itemsize):
19754  */
19755  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1296, __pyx_L1_error)
19756 
19757  /* "View.MemoryView":1295
19758  * _err_extents(i, dst.shape[i], src.shape[i])
19759  *
19760  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19761  * _err_dim(ValueError, "Dimension %d is not direct", i)
19762  *
19763  */
19764  }
19765  }
19766 
19767  /* "View.MemoryView":1298
19768  * _err_dim(ValueError, "Dimension %d is not direct", i)
19769  *
19770  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19771  *
19772  * if not slice_is_contig(src, order, ndim):
19773  */
19774  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19775  if (__pyx_t_2) {
19776 
19777  /* "View.MemoryView":1300
19778  * if slices_overlap(&src, &dst, ndim, itemsize):
19779  *
19780  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19781  * order = get_best_order(&dst, ndim)
19782  *
19783  */
19784  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19785  if (__pyx_t_2) {
19786 
19787  /* "View.MemoryView":1301
19788  *
19789  * if not slice_is_contig(src, order, ndim):
19790  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
19791  *
19792  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19793  */
19794  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19795 
19796  /* "View.MemoryView":1300
19797  * if slices_overlap(&src, &dst, ndim, itemsize):
19798  *
19799  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19800  * order = get_best_order(&dst, ndim)
19801  *
19802  */
19803  }
19804 
19805  /* "View.MemoryView":1303
19806  * order = get_best_order(&dst, ndim)
19807  *
19808  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
19809  * src = tmp
19810  *
19811  */
19812  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1303, __pyx_L1_error)
19813  __pyx_v_tmpdata = __pyx_t_7;
19814 
19815  /* "View.MemoryView":1304
19816  *
19817  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19818  * src = tmp # <<<<<<<<<<<<<<
19819  *
19820  * if not broadcasting:
19821  */
19822  __pyx_v_src = __pyx_v_tmp;
19823 
19824  /* "View.MemoryView":1298
19825  * _err_dim(ValueError, "Dimension %d is not direct", i)
19826  *
19827  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19828  *
19829  * if not slice_is_contig(src, order, ndim):
19830  */
19831  }
19832 
19833  /* "View.MemoryView":1306
19834  * src = tmp
19835  *
19836  * if not broadcasting: # <<<<<<<<<<<<<<
19837  *
19838  *
19839  */
19840  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19841  if (__pyx_t_2) {
19842 
19843  /* "View.MemoryView":1309
19844  *
19845  *
19846  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19847  * direct_copy = slice_is_contig(dst, 'C', ndim)
19848  * elif slice_is_contig(src, 'F', ndim):
19849  */
19850  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
19851  if (__pyx_t_2) {
19852 
19853  /* "View.MemoryView":1310
19854  *
19855  * if slice_is_contig(src, 'C', ndim):
19856  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
19857  * elif slice_is_contig(src, 'F', ndim):
19858  * direct_copy = slice_is_contig(dst, 'F', ndim)
19859  */
19860  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
19861 
19862  /* "View.MemoryView":1309
19863  *
19864  *
19865  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19866  * direct_copy = slice_is_contig(dst, 'C', ndim)
19867  * elif slice_is_contig(src, 'F', ndim):
19868  */
19869  goto __pyx_L12;
19870  }
19871 
19872  /* "View.MemoryView":1311
19873  * if slice_is_contig(src, 'C', ndim):
19874  * direct_copy = slice_is_contig(dst, 'C', ndim)
19875  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19876  * direct_copy = slice_is_contig(dst, 'F', ndim)
19877  *
19878  */
19879  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
19880  if (__pyx_t_2) {
19881 
19882  /* "View.MemoryView":1312
19883  * direct_copy = slice_is_contig(dst, 'C', ndim)
19884  * elif slice_is_contig(src, 'F', ndim):
19885  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
19886  *
19887  * if direct_copy:
19888  */
19889  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
19890 
19891  /* "View.MemoryView":1311
19892  * if slice_is_contig(src, 'C', ndim):
19893  * direct_copy = slice_is_contig(dst, 'C', ndim)
19894  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19895  * direct_copy = slice_is_contig(dst, 'F', ndim)
19896  *
19897  */
19898  }
19899  __pyx_L12:;
19900 
19901  /* "View.MemoryView":1314
19902  * direct_copy = slice_is_contig(dst, 'F', ndim)
19903  *
19904  * if direct_copy: # <<<<<<<<<<<<<<
19905  *
19906  * refcount_copying(&dst, dtype_is_object, ndim, False)
19907  */
19908  __pyx_t_2 = (__pyx_v_direct_copy != 0);
19909  if (__pyx_t_2) {
19910 
19911  /* "View.MemoryView":1316
19912  * if direct_copy:
19913  *
19914  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19915  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19916  * refcount_copying(&dst, dtype_is_object, ndim, True)
19917  */
19918  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19919 
19920  /* "View.MemoryView":1317
19921  *
19922  * refcount_copying(&dst, dtype_is_object, ndim, False)
19923  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
19924  * refcount_copying(&dst, dtype_is_object, ndim, True)
19925  * free(tmpdata)
19926  */
19927  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19928 
19929  /* "View.MemoryView":1318
19930  * refcount_copying(&dst, dtype_is_object, ndim, False)
19931  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19932  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19933  * free(tmpdata)
19934  * return 0
19935  */
19936  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19937 
19938  /* "View.MemoryView":1319
19939  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19940  * refcount_copying(&dst, dtype_is_object, ndim, True)
19941  * free(tmpdata) # <<<<<<<<<<<<<<
19942  * return 0
19943  *
19944  */
19945  free(__pyx_v_tmpdata);
19946 
19947  /* "View.MemoryView":1320
19948  * refcount_copying(&dst, dtype_is_object, ndim, True)
19949  * free(tmpdata)
19950  * return 0 # <<<<<<<<<<<<<<
19951  *
19952  * if order == 'F' == get_best_order(&dst, ndim):
19953  */
19954  __pyx_r = 0;
19955  goto __pyx_L0;
19956 
19957  /* "View.MemoryView":1314
19958  * direct_copy = slice_is_contig(dst, 'F', ndim)
19959  *
19960  * if direct_copy: # <<<<<<<<<<<<<<
19961  *
19962  * refcount_copying(&dst, dtype_is_object, ndim, False)
19963  */
19964  }
19965 
19966  /* "View.MemoryView":1306
19967  * src = tmp
19968  *
19969  * if not broadcasting: # <<<<<<<<<<<<<<
19970  *
19971  *
19972  */
19973  }
19974 
19975  /* "View.MemoryView":1322
19976  * return 0
19977  *
19978  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
19979  *
19980  *
19981  */
19982  __pyx_t_2 = (__pyx_v_order == 'F');
19983  if (__pyx_t_2) {
19984  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19985  }
19986  __pyx_t_8 = (__pyx_t_2 != 0);
19987  if (__pyx_t_8) {
19988 
19989  /* "View.MemoryView":1325
19990  *
19991  *
19992  * transpose_memslice(&src) # <<<<<<<<<<<<<<
19993  * transpose_memslice(&dst)
19994  *
19995  */
19996  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1325, __pyx_L1_error)
19997 
19998  /* "View.MemoryView":1326
19999  *
20000  * transpose_memslice(&src)
20001  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20002  *
20003  * refcount_copying(&dst, dtype_is_object, ndim, False)
20004  */
20005  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1326, __pyx_L1_error)
20006 
20007  /* "View.MemoryView":1322
20008  * return 0
20009  *
20010  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20011  *
20012  *
20013  */
20014  }
20015 
20016  /* "View.MemoryView":1328
20017  * transpose_memslice(&dst)
20018  *
20019  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20020  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20021  * refcount_copying(&dst, dtype_is_object, ndim, True)
20022  */
20023  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20024 
20025  /* "View.MemoryView":1329
20026  *
20027  * refcount_copying(&dst, dtype_is_object, ndim, False)
20028  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20029  * refcount_copying(&dst, dtype_is_object, ndim, True)
20030  *
20031  */
20032  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20033 
20034  /* "View.MemoryView":1330
20035  * refcount_copying(&dst, dtype_is_object, ndim, False)
20036  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20037  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20038  *
20039  * free(tmpdata)
20040  */
20041  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20042 
20043  /* "View.MemoryView":1332
20044  * refcount_copying(&dst, dtype_is_object, ndim, True)
20045  *
20046  * free(tmpdata) # <<<<<<<<<<<<<<
20047  * return 0
20048  *
20049  */
20050  free(__pyx_v_tmpdata);
20051 
20052  /* "View.MemoryView":1333
20053  *
20054  * free(tmpdata)
20055  * return 0 # <<<<<<<<<<<<<<
20056  *
20057  * @cname('__pyx_memoryview_broadcast_leading')
20058  */
20059  __pyx_r = 0;
20060  goto __pyx_L0;
20061 
20062  /* "View.MemoryView":1264
20063  *
20064  * @cname('__pyx_memoryview_copy_contents')
20065  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20066  * __Pyx_memviewslice dst,
20067  * int src_ndim, int dst_ndim,
20068  */
20069 
20070  /* function exit code */
20071  __pyx_L1_error:;
20072  {
20073  #ifdef WITH_THREAD
20074  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20075  #endif
20076  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20077  #ifdef WITH_THREAD
20078  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20079  #endif
20080  }
20081  __pyx_r = -1;
20082  __pyx_L0:;
20083  return __pyx_r;
20084 }
20085 
20086 /* "View.MemoryView":1336
20087  *
20088  * @cname('__pyx_memoryview_broadcast_leading')
20089  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20090  * int ndim,
20091  * int ndim_other) nogil:
20092  */
20093 
20094 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20095  int __pyx_v_i;
20096  int __pyx_v_offset;
20097  int __pyx_t_1;
20098  int __pyx_t_2;
20099  int __pyx_t_3;
20100 
20101  /* "View.MemoryView":1340
20102  * int ndim_other) nogil:
20103  * cdef int i
20104  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20105  *
20106  * for i in range(ndim - 1, -1, -1):
20107  */
20108  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20109 
20110  /* "View.MemoryView":1342
20111  * cdef int offset = ndim_other - ndim
20112  *
20113  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20114  * mslice.shape[i + offset] = mslice.shape[i]
20115  * mslice.strides[i + offset] = mslice.strides[i]
20116  */
20117  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20118  __pyx_v_i = __pyx_t_1;
20119 
20120  /* "View.MemoryView":1343
20121  *
20122  * for i in range(ndim - 1, -1, -1):
20123  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20124  * mslice.strides[i + offset] = mslice.strides[i]
20125  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20126  */
20127  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20128 
20129  /* "View.MemoryView":1344
20130  * for i in range(ndim - 1, -1, -1):
20131  * mslice.shape[i + offset] = mslice.shape[i]
20132  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20133  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20134  *
20135  */
20136  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20137 
20138  /* "View.MemoryView":1345
20139  * mslice.shape[i + offset] = mslice.shape[i]
20140  * mslice.strides[i + offset] = mslice.strides[i]
20141  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20142  *
20143  * for i in range(offset):
20144  */
20145  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20146  }
20147 
20148  /* "View.MemoryView":1347
20149  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20150  *
20151  * for i in range(offset): # <<<<<<<<<<<<<<
20152  * mslice.shape[i] = 1
20153  * mslice.strides[i] = mslice.strides[0]
20154  */
20155  __pyx_t_1 = __pyx_v_offset;
20156  __pyx_t_2 = __pyx_t_1;
20157  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20158  __pyx_v_i = __pyx_t_3;
20159 
20160  /* "View.MemoryView":1348
20161  *
20162  * for i in range(offset):
20163  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20164  * mslice.strides[i] = mslice.strides[0]
20165  * mslice.suboffsets[i] = -1
20166  */
20167  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20168 
20169  /* "View.MemoryView":1349
20170  * for i in range(offset):
20171  * mslice.shape[i] = 1
20172  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20173  * mslice.suboffsets[i] = -1
20174  *
20175  */
20176  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20177 
20178  /* "View.MemoryView":1350
20179  * mslice.shape[i] = 1
20180  * mslice.strides[i] = mslice.strides[0]
20181  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20182  *
20183  *
20184  */
20185  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20186  }
20187 
20188  /* "View.MemoryView":1336
20189  *
20190  * @cname('__pyx_memoryview_broadcast_leading')
20191  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20192  * int ndim,
20193  * int ndim_other) nogil:
20194  */
20195 
20196  /* function exit code */
20197 }
20198 
20199 /* "View.MemoryView":1358
20200  *
20201  * @cname('__pyx_memoryview_refcount_copying')
20202  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20203  * int ndim, bint inc) nogil:
20204  *
20205  */
20206 
20207 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
20208  int __pyx_t_1;
20209 
20210  /* "View.MemoryView":1362
20211  *
20212  *
20213  * if dtype_is_object: # <<<<<<<<<<<<<<
20214  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20215  * dst.strides, ndim, inc)
20216  */
20217  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20218  if (__pyx_t_1) {
20219 
20220  /* "View.MemoryView":1363
20221  *
20222  * if dtype_is_object:
20223  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
20224  * dst.strides, ndim, inc)
20225  *
20226  */
20227  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20228 
20229  /* "View.MemoryView":1362
20230  *
20231  *
20232  * if dtype_is_object: # <<<<<<<<<<<<<<
20233  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20234  * dst.strides, ndim, inc)
20235  */
20236  }
20237 
20238  /* "View.MemoryView":1358
20239  *
20240  * @cname('__pyx_memoryview_refcount_copying')
20241  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20242  * int ndim, bint inc) nogil:
20243  *
20244  */
20245 
20246  /* function exit code */
20247 }
20248 
20249 /* "View.MemoryView":1367
20250  *
20251  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20252  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20253  * Py_ssize_t *strides, int ndim,
20254  * bint inc) with gil:
20255  */
20256 
20257 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20258  __Pyx_RefNannyDeclarations
20259  #ifdef WITH_THREAD
20260  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20261  #endif
20262  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
20263 
20264  /* "View.MemoryView":1370
20265  * Py_ssize_t *strides, int ndim,
20266  * bint inc) with gil:
20267  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
20268  *
20269  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20270  */
20271  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20272 
20273  /* "View.MemoryView":1367
20274  *
20275  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20276  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20277  * Py_ssize_t *strides, int ndim,
20278  * bint inc) with gil:
20279  */
20280 
20281  /* function exit code */
20282  __Pyx_RefNannyFinishContext();
20283  #ifdef WITH_THREAD
20284  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20285  #endif
20286 }
20287 
20288 /* "View.MemoryView":1373
20289  *
20290  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20291  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20292  * Py_ssize_t *strides, int ndim, bint inc):
20293  * cdef Py_ssize_t i
20294  */
20295 
20296 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20297  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20298  __Pyx_RefNannyDeclarations
20299  Py_ssize_t __pyx_t_1;
20300  Py_ssize_t __pyx_t_2;
20301  Py_ssize_t __pyx_t_3;
20302  int __pyx_t_4;
20303  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20304 
20305  /* "View.MemoryView":1377
20306  * cdef Py_ssize_t i
20307  *
20308  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20309  * if ndim == 1:
20310  * if inc:
20311  */
20312  __pyx_t_1 = (__pyx_v_shape[0]);
20313  __pyx_t_2 = __pyx_t_1;
20314  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20315  __pyx_v_i = __pyx_t_3;
20316 
20317  /* "View.MemoryView":1378
20318  *
20319  * for i in range(shape[0]):
20320  * if ndim == 1: # <<<<<<<<<<<<<<
20321  * if inc:
20322  * Py_INCREF((<PyObject **> data)[0])
20323  */
20324  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20325  if (__pyx_t_4) {
20326 
20327  /* "View.MemoryView":1379
20328  * for i in range(shape[0]):
20329  * if ndim == 1:
20330  * if inc: # <<<<<<<<<<<<<<
20331  * Py_INCREF((<PyObject **> data)[0])
20332  * else:
20333  */
20334  __pyx_t_4 = (__pyx_v_inc != 0);
20335  if (__pyx_t_4) {
20336 
20337  /* "View.MemoryView":1380
20338  * if ndim == 1:
20339  * if inc:
20340  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20341  * else:
20342  * Py_DECREF((<PyObject **> data)[0])
20343  */
20344  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20345 
20346  /* "View.MemoryView":1379
20347  * for i in range(shape[0]):
20348  * if ndim == 1:
20349  * if inc: # <<<<<<<<<<<<<<
20350  * Py_INCREF((<PyObject **> data)[0])
20351  * else:
20352  */
20353  goto __pyx_L6;
20354  }
20355 
20356  /* "View.MemoryView":1382
20357  * Py_INCREF((<PyObject **> data)[0])
20358  * else:
20359  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20360  * else:
20361  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20362  */
20363  /*else*/ {
20364  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20365  }
20366  __pyx_L6:;
20367 
20368  /* "View.MemoryView":1378
20369  *
20370  * for i in range(shape[0]):
20371  * if ndim == 1: # <<<<<<<<<<<<<<
20372  * if inc:
20373  * Py_INCREF((<PyObject **> data)[0])
20374  */
20375  goto __pyx_L5;
20376  }
20377 
20378  /* "View.MemoryView":1384
20379  * Py_DECREF((<PyObject **> data)[0])
20380  * else:
20381  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20382  * ndim - 1, inc)
20383  *
20384  */
20385  /*else*/ {
20386 
20387  /* "View.MemoryView":1385
20388  * else:
20389  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20390  * ndim - 1, inc) # <<<<<<<<<<<<<<
20391  *
20392  * data += strides[0]
20393  */
20394  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20395  }
20396  __pyx_L5:;
20397 
20398  /* "View.MemoryView":1387
20399  * ndim - 1, inc)
20400  *
20401  * data += strides[0] # <<<<<<<<<<<<<<
20402  *
20403  *
20404  */
20405  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20406  }
20407 
20408  /* "View.MemoryView":1373
20409  *
20410  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20411  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20412  * Py_ssize_t *strides, int ndim, bint inc):
20413  * cdef Py_ssize_t i
20414  */
20415 
20416  /* function exit code */
20417  __Pyx_RefNannyFinishContext();
20418 }
20419 
20420 /* "View.MemoryView":1393
20421  *
20422  * @cname('__pyx_memoryview_slice_assign_scalar')
20423  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20424  * size_t itemsize, void *item,
20425  * bint dtype_is_object) nogil:
20426  */
20427 
20428 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
20429 
20430  /* "View.MemoryView":1396
20431  * size_t itemsize, void *item,
20432  * bint dtype_is_object) nogil:
20433  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20434  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20435  * itemsize, item)
20436  */
20437  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20438 
20439  /* "View.MemoryView":1397
20440  * bint dtype_is_object) nogil:
20441  * refcount_copying(dst, dtype_is_object, ndim, False)
20442  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
20443  * itemsize, item)
20444  * refcount_copying(dst, dtype_is_object, ndim, True)
20445  */
20446  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20447 
20448  /* "View.MemoryView":1399
20449  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20450  * itemsize, item)
20451  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20452  *
20453  *
20454  */
20455  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20456 
20457  /* "View.MemoryView":1393
20458  *
20459  * @cname('__pyx_memoryview_slice_assign_scalar')
20460  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20461  * size_t itemsize, void *item,
20462  * bint dtype_is_object) nogil:
20463  */
20464 
20465  /* function exit code */
20466 }
20467 
20468 /* "View.MemoryView":1403
20469  *
20470  * @cname('__pyx_memoryview__slice_assign_scalar')
20471  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20472  * Py_ssize_t *strides, int ndim,
20473  * size_t itemsize, void *item) nogil:
20474  */
20475 
20476 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
20477  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20478  Py_ssize_t __pyx_v_stride;
20479  Py_ssize_t __pyx_v_extent;
20480  int __pyx_t_1;
20481  Py_ssize_t __pyx_t_2;
20482  Py_ssize_t __pyx_t_3;
20483  Py_ssize_t __pyx_t_4;
20484 
20485  /* "View.MemoryView":1407
20486  * size_t itemsize, void *item) nogil:
20487  * cdef Py_ssize_t i
20488  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
20489  * cdef Py_ssize_t extent = shape[0]
20490  *
20491  */
20492  __pyx_v_stride = (__pyx_v_strides[0]);
20493 
20494  /* "View.MemoryView":1408
20495  * cdef Py_ssize_t i
20496  * cdef Py_ssize_t stride = strides[0]
20497  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
20498  *
20499  * if ndim == 1:
20500  */
20501  __pyx_v_extent = (__pyx_v_shape[0]);
20502 
20503  /* "View.MemoryView":1410
20504  * cdef Py_ssize_t extent = shape[0]
20505  *
20506  * if ndim == 1: # <<<<<<<<<<<<<<
20507  * for i in range(extent):
20508  * memcpy(data, item, itemsize)
20509  */
20510  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20511  if (__pyx_t_1) {
20512 
20513  /* "View.MemoryView":1411
20514  *
20515  * if ndim == 1:
20516  * for i in range(extent): # <<<<<<<<<<<<<<
20517  * memcpy(data, item, itemsize)
20518  * data += stride
20519  */
20520  __pyx_t_2 = __pyx_v_extent;
20521  __pyx_t_3 = __pyx_t_2;
20522  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20523  __pyx_v_i = __pyx_t_4;
20524 
20525  /* "View.MemoryView":1412
20526  * if ndim == 1:
20527  * for i in range(extent):
20528  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
20529  * data += stride
20530  * else:
20531  */
20532  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20533 
20534  /* "View.MemoryView":1413
20535  * for i in range(extent):
20536  * memcpy(data, item, itemsize)
20537  * data += stride # <<<<<<<<<<<<<<
20538  * else:
20539  * for i in range(extent):
20540  */
20541  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20542  }
20543 
20544  /* "View.MemoryView":1410
20545  * cdef Py_ssize_t extent = shape[0]
20546  *
20547  * if ndim == 1: # <<<<<<<<<<<<<<
20548  * for i in range(extent):
20549  * memcpy(data, item, itemsize)
20550  */
20551  goto __pyx_L3;
20552  }
20553 
20554  /* "View.MemoryView":1415
20555  * data += stride
20556  * else:
20557  * for i in range(extent): # <<<<<<<<<<<<<<
20558  * _slice_assign_scalar(data, shape + 1, strides + 1,
20559  * ndim - 1, itemsize, item)
20560  */
20561  /*else*/ {
20562  __pyx_t_2 = __pyx_v_extent;
20563  __pyx_t_3 = __pyx_t_2;
20564  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20565  __pyx_v_i = __pyx_t_4;
20566 
20567  /* "View.MemoryView":1416
20568  * else:
20569  * for i in range(extent):
20570  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20571  * ndim - 1, itemsize, item)
20572  * data += stride
20573  */
20574  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20575 
20576  /* "View.MemoryView":1418
20577  * _slice_assign_scalar(data, shape + 1, strides + 1,
20578  * ndim - 1, itemsize, item)
20579  * data += stride # <<<<<<<<<<<<<<
20580  *
20581  *
20582  */
20583  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20584  }
20585  }
20586  __pyx_L3:;
20587 
20588  /* "View.MemoryView":1403
20589  *
20590  * @cname('__pyx_memoryview__slice_assign_scalar')
20591  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20592  * Py_ssize_t *strides, int ndim,
20593  * size_t itemsize, void *item) nogil:
20594  */
20595 
20596  /* function exit code */
20597 }
20598 
20599 /* "(tree fragment)":1
20600  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20601  * if __pyx_checksum != 0xb068931:
20602  * from pickle import PickleError as __pyx_PickleError
20603  */
20604 
20605 /* Python wrapper */
20606 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20607 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20608 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20609  PyObject *__pyx_v___pyx_type = 0;
20610  long __pyx_v___pyx_checksum;
20611  PyObject *__pyx_v___pyx_state = 0;
20612  PyObject *__pyx_r = 0;
20613  __Pyx_RefNannyDeclarations
20614  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
20615  {
20616  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20617  PyObject* values[3] = {0,0,0};
20618  if (unlikely(__pyx_kwds)) {
20619  Py_ssize_t kw_args;
20620  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20621  switch (pos_args) {
20622  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20623  CYTHON_FALLTHROUGH;
20624  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20625  CYTHON_FALLTHROUGH;
20626  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20627  CYTHON_FALLTHROUGH;
20628  case 0: break;
20629  default: goto __pyx_L5_argtuple_error;
20630  }
20631  kw_args = PyDict_Size(__pyx_kwds);
20632  switch (pos_args) {
20633  case 0:
20634  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20635  else goto __pyx_L5_argtuple_error;
20636  CYTHON_FALLTHROUGH;
20637  case 1:
20638  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20639  else {
20640  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20641  }
20642  CYTHON_FALLTHROUGH;
20643  case 2:
20644  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20645  else {
20646  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20647  }
20648  }
20649  if (unlikely(kw_args > 0)) {
20650  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20651  }
20652  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20653  goto __pyx_L5_argtuple_error;
20654  } else {
20655  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20656  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20657  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20658  }
20659  __pyx_v___pyx_type = values[0];
20660  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20661  __pyx_v___pyx_state = values[2];
20662  }
20663  goto __pyx_L4_argument_unpacking_done;
20664  __pyx_L5_argtuple_error:;
20665  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20666  __pyx_L3_error:;
20667  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20668  __Pyx_RefNannyFinishContext();
20669  return NULL;
20670  __pyx_L4_argument_unpacking_done:;
20671  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20672 
20673  /* function exit code */
20674  __Pyx_RefNannyFinishContext();
20675  return __pyx_r;
20676 }
20677 
20678 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20679  PyObject *__pyx_v___pyx_PickleError = NULL;
20680  PyObject *__pyx_v___pyx_result = NULL;
20681  PyObject *__pyx_r = NULL;
20682  __Pyx_RefNannyDeclarations
20683  int __pyx_t_1;
20684  PyObject *__pyx_t_2 = NULL;
20685  PyObject *__pyx_t_3 = NULL;
20686  PyObject *__pyx_t_4 = NULL;
20687  PyObject *__pyx_t_5 = NULL;
20688  PyObject *__pyx_t_6 = NULL;
20689  int __pyx_t_7;
20690  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
20691 
20692  /* "(tree fragment)":2
20693  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
20694  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20695  * from pickle import PickleError as __pyx_PickleError
20696  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20697  */
20698  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
20699  if (__pyx_t_1) {
20700 
20701  /* "(tree fragment)":3
20702  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
20703  * if __pyx_checksum != 0xb068931:
20704  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
20705  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20706  * __pyx_result = Enum.__new__(__pyx_type)
20707  */
20708  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
20709  __Pyx_GOTREF(__pyx_t_2);
20710  __Pyx_INCREF(__pyx_n_s_PickleError);
20711  __Pyx_GIVEREF(__pyx_n_s_PickleError);
20712  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
20713  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
20714  __Pyx_GOTREF(__pyx_t_3);
20715  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20716  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
20717  __Pyx_GOTREF(__pyx_t_2);
20718  __Pyx_INCREF(__pyx_t_2);
20719  __pyx_v___pyx_PickleError = __pyx_t_2;
20720  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20721  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20722 
20723  /* "(tree fragment)":4
20724  * if __pyx_checksum != 0xb068931:
20725  * from pickle import PickleError as __pyx_PickleError
20726  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
20727  * __pyx_result = Enum.__new__(__pyx_type)
20728  * if __pyx_state is not None:
20729  */
20730  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error)
20731  __Pyx_GOTREF(__pyx_t_2);
20732  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
20733  __Pyx_GOTREF(__pyx_t_4);
20734  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20735  __Pyx_INCREF(__pyx_v___pyx_PickleError);
20736  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
20737  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20738  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
20739  if (likely(__pyx_t_5)) {
20740  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20741  __Pyx_INCREF(__pyx_t_5);
20742  __Pyx_INCREF(function);
20743  __Pyx_DECREF_SET(__pyx_t_2, function);
20744  }
20745  }
20746  if (!__pyx_t_5) {
20747  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
20748  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20749  __Pyx_GOTREF(__pyx_t_3);
20750  } else {
20751  #if CYTHON_FAST_PYCALL
20752  if (PyFunction_Check(__pyx_t_2)) {
20753  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
20754  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
20755  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20756  __Pyx_GOTREF(__pyx_t_3);
20757  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20758  } else
20759  #endif
20760  #if CYTHON_FAST_PYCCALL
20761  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
20762  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
20763  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
20764  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20765  __Pyx_GOTREF(__pyx_t_3);
20766  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20767  } else
20768  #endif
20769  {
20770  __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4, __pyx_L1_error)
20771  __Pyx_GOTREF(__pyx_t_6);
20772  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
20773  __Pyx_GIVEREF(__pyx_t_4);
20774  PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
20775  __pyx_t_4 = 0;
20776  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
20777  __Pyx_GOTREF(__pyx_t_3);
20778  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20779  }
20780  }
20781  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20782  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20783  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20784  __PYX_ERR(1, 4, __pyx_L1_error)
20785 
20786  /* "(tree fragment)":2
20787  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
20788  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20789  * from pickle import PickleError as __pyx_PickleError
20790  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20791  */
20792  }
20793 
20794  /* "(tree fragment)":5
20795  * from pickle import PickleError as __pyx_PickleError
20796  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20797  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
20798  * if __pyx_state is not None:
20799  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20800  */
20801  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20802  __Pyx_GOTREF(__pyx_t_2);
20803  __pyx_t_6 = NULL;
20804  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
20805  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
20806  if (likely(__pyx_t_6)) {
20807  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20808  __Pyx_INCREF(__pyx_t_6);
20809  __Pyx_INCREF(function);
20810  __Pyx_DECREF_SET(__pyx_t_2, function);
20811  }
20812  }
20813  if (!__pyx_t_6) {
20814  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
20815  __Pyx_GOTREF(__pyx_t_3);
20816  } else {
20817  #if CYTHON_FAST_PYCALL
20818  if (PyFunction_Check(__pyx_t_2)) {
20819  PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
20820  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
20821  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20822  __Pyx_GOTREF(__pyx_t_3);
20823  } else
20824  #endif
20825  #if CYTHON_FAST_PYCCALL
20826  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
20827  PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
20828  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
20829  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20830  __Pyx_GOTREF(__pyx_t_3);
20831  } else
20832  #endif
20833  {
20834  __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
20835  __Pyx_GOTREF(__pyx_t_4);
20836  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
20837  __Pyx_INCREF(__pyx_v___pyx_type);
20838  __Pyx_GIVEREF(__pyx_v___pyx_type);
20839  PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
20840  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
20841  __Pyx_GOTREF(__pyx_t_3);
20842  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20843  }
20844  }
20845  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20846  __pyx_v___pyx_result = __pyx_t_3;
20847  __pyx_t_3 = 0;
20848 
20849  /* "(tree fragment)":6
20850  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20851  * __pyx_result = Enum.__new__(__pyx_type)
20852  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20853  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20854  * return __pyx_result
20855  */
20856  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
20857  __pyx_t_7 = (__pyx_t_1 != 0);
20858  if (__pyx_t_7) {
20859 
20860  /* "(tree fragment)":7
20861  * __pyx_result = Enum.__new__(__pyx_type)
20862  * if __pyx_state is not None:
20863  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
20864  * return __pyx_result
20865  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20866  */
20867  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 7, __pyx_L1_error)
20868  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
20869  __Pyx_GOTREF(__pyx_t_3);
20870  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20871 
20872  /* "(tree fragment)":6
20873  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20874  * __pyx_result = Enum.__new__(__pyx_type)
20875  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20876  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20877  * return __pyx_result
20878  */
20879  }
20880 
20881  /* "(tree fragment)":8
20882  * if __pyx_state is not None:
20883  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20884  * return __pyx_result # <<<<<<<<<<<<<<
20885  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20886  * __pyx_result.name = __pyx_state[0]
20887  */
20888  __Pyx_XDECREF(__pyx_r);
20889  __Pyx_INCREF(__pyx_v___pyx_result);
20890  __pyx_r = __pyx_v___pyx_result;
20891  goto __pyx_L0;
20892 
20893  /* "(tree fragment)":1
20894  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20895  * if __pyx_checksum != 0xb068931:
20896  * from pickle import PickleError as __pyx_PickleError
20897  */
20898 
20899  /* function exit code */
20900  __pyx_L1_error:;
20901  __Pyx_XDECREF(__pyx_t_2);
20902  __Pyx_XDECREF(__pyx_t_3);
20903  __Pyx_XDECREF(__pyx_t_4);
20904  __Pyx_XDECREF(__pyx_t_5);
20905  __Pyx_XDECREF(__pyx_t_6);
20906  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20907  __pyx_r = NULL;
20908  __pyx_L0:;
20909  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20910  __Pyx_XDECREF(__pyx_v___pyx_result);
20911  __Pyx_XGIVEREF(__pyx_r);
20912  __Pyx_RefNannyFinishContext();
20913  return __pyx_r;
20914 }
20915 
20916 /* "(tree fragment)":9
20917  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20918  * return __pyx_result
20919  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20920  * __pyx_result.name = __pyx_state[0]
20921  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20922  */
20923 
20924 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20925  PyObject *__pyx_r = NULL;
20926  __Pyx_RefNannyDeclarations
20927  PyObject *__pyx_t_1 = NULL;
20928  int __pyx_t_2;
20929  Py_ssize_t __pyx_t_3;
20930  int __pyx_t_4;
20931  int __pyx_t_5;
20932  PyObject *__pyx_t_6 = NULL;
20933  PyObject *__pyx_t_7 = NULL;
20934  PyObject *__pyx_t_8 = NULL;
20935  PyObject *__pyx_t_9 = NULL;
20936  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
20937 
20938  /* "(tree fragment)":10
20939  * return __pyx_result
20940  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20941  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
20942  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20943  * __pyx_result.__dict__.update(__pyx_state[1])
20944  */
20945  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20946  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20947  __PYX_ERR(1, 10, __pyx_L1_error)
20948  }
20949  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
20950  __Pyx_GOTREF(__pyx_t_1);
20951  __Pyx_GIVEREF(__pyx_t_1);
20952  __Pyx_GOTREF(__pyx_v___pyx_result->name);
20953  __Pyx_DECREF(__pyx_v___pyx_result->name);
20954  __pyx_v___pyx_result->name = __pyx_t_1;
20955  __pyx_t_1 = 0;
20956 
20957  /* "(tree fragment)":11
20958  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20959  * __pyx_result.name = __pyx_state[0]
20960  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20961  * __pyx_result.__dict__.update(__pyx_state[1])
20962  */
20963  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20964  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
20965  __PYX_ERR(1, 11, __pyx_L1_error)
20966  }
20967  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
20968  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20969  if (__pyx_t_4) {
20970  } else {
20971  __pyx_t_2 = __pyx_t_4;
20972  goto __pyx_L4_bool_binop_done;
20973  }
20974  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
20975  __pyx_t_5 = (__pyx_t_4 != 0);
20976  __pyx_t_2 = __pyx_t_5;
20977  __pyx_L4_bool_binop_done:;
20978  if (__pyx_t_2) {
20979 
20980  /* "(tree fragment)":12
20981  * __pyx_result.name = __pyx_state[0]
20982  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20983  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
20984  */
20985  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
20986  __Pyx_GOTREF(__pyx_t_6);
20987  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error)
20988  __Pyx_GOTREF(__pyx_t_7);
20989  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20990  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20991  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20992  __PYX_ERR(1, 12, __pyx_L1_error)
20993  }
20994  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
20995  __Pyx_GOTREF(__pyx_t_6);
20996  __pyx_t_8 = NULL;
20997  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
20998  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20999  if (likely(__pyx_t_8)) {
21000  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21001  __Pyx_INCREF(__pyx_t_8);
21002  __Pyx_INCREF(function);
21003  __Pyx_DECREF_SET(__pyx_t_7, function);
21004  }
21005  }
21006  if (!__pyx_t_8) {
21007  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21008  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21009  __Pyx_GOTREF(__pyx_t_1);
21010  } else {
21011  #if CYTHON_FAST_PYCALL
21012  if (PyFunction_Check(__pyx_t_7)) {
21013  PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
21014  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21015  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21016  __Pyx_GOTREF(__pyx_t_1);
21017  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21018  } else
21019  #endif
21020  #if CYTHON_FAST_PYCCALL
21021  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
21022  PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
21023  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21024  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21025  __Pyx_GOTREF(__pyx_t_1);
21026  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21027  } else
21028  #endif
21029  {
21030  __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 12, __pyx_L1_error)
21031  __Pyx_GOTREF(__pyx_t_9);
21032  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
21033  __Pyx_GIVEREF(__pyx_t_6);
21034  PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
21035  __pyx_t_6 = 0;
21036  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21037  __Pyx_GOTREF(__pyx_t_1);
21038  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21039  }
21040  }
21041  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21042  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21043 
21044  /* "(tree fragment)":11
21045  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21046  * __pyx_result.name = __pyx_state[0]
21047  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21048  * __pyx_result.__dict__.update(__pyx_state[1])
21049  */
21050  }
21051 
21052  /* "(tree fragment)":9
21053  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21054  * return __pyx_result
21055  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21056  * __pyx_result.name = __pyx_state[0]
21057  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21058  */
21059 
21060  /* function exit code */
21061  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21062  goto __pyx_L0;
21063  __pyx_L1_error:;
21064  __Pyx_XDECREF(__pyx_t_1);
21065  __Pyx_XDECREF(__pyx_t_6);
21066  __Pyx_XDECREF(__pyx_t_7);
21067  __Pyx_XDECREF(__pyx_t_8);
21068  __Pyx_XDECREF(__pyx_t_9);
21069  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21070  __pyx_r = 0;
21071  __pyx_L0:;
21072  __Pyx_XGIVEREF(__pyx_r);
21073  __Pyx_RefNannyFinishContext();
21074  return __pyx_r;
21075 }
21076 
21077 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21078  struct __pyx_obj_18BoundaryConditions_BC_Base *p;
21079  PyObject *o;
21080  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21081  o = (*t->tp_alloc)(t, 0);
21082  } else {
21083  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21084  }
21085  if (unlikely(!o)) return 0;
21086  p = ((struct __pyx_obj_18BoundaryConditions_BC_Base *)o);
21087  p->Shape = Py_None; Py_INCREF(Py_None);
21088  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
21089  p->BC_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
21090  p->ct = Py_None; Py_INCREF(Py_None);
21091  p->_b_or.data = NULL;
21092  p->_b_or.memview = NULL;
21093  return o;
21094 }
21095 
21096 static void __pyx_tp_dealloc_18BoundaryConditions_BC_Base(PyObject *o) {
21097  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21098  #if CYTHON_USE_TP_FINALIZE
21099  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21100  if (PyObject_CallFinalizerFromDealloc(o)) return;
21101  }
21102  #endif
21103  PyObject_GC_UnTrack(o);
21104  Py_CLEAR(p->Shape);
21105  Py_CLEAR(p->name);
21106  Py_CLEAR(p->BC_type);
21107  Py_CLEAR(p->ct);
21108  __PYX_XDEC_MEMVIEW(&p->_b_or, 1);
21109  (*Py_TYPE(o)->tp_free)(o);
21110 }
21111 
21112 static int __pyx_tp_traverse_18BoundaryConditions_BC_Base(PyObject *o, visitproc v, void *a) {
21113  int e;
21114  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21115  if (p->Shape) {
21116  e = (*v)(p->Shape, a); if (e) return e;
21117  }
21118  if (p->ct) {
21119  e = (*v)(p->ct, a); if (e) return e;
21120  }
21121  return 0;
21122 }
21123 
21124 static int __pyx_tp_clear_18BoundaryConditions_BC_Base(PyObject *o) {
21125  PyObject* tmp;
21126  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21127  tmp = ((PyObject*)p->Shape);
21128  p->Shape = Py_None; Py_INCREF(Py_None);
21129  Py_XDECREF(tmp);
21130  tmp = ((PyObject*)p->ct);
21131  p->ct = Py_None; Py_INCREF(Py_None);
21132  Py_XDECREF(tmp);
21133  return 0;
21134 }
21135 
21136 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, CYTHON_UNUSED void *x) {
21137  return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(o);
21138 }
21139 
21140 static int __pyx_setprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21141  if (v) {
21142  return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(o, v);
21143  }
21144  else {
21145  PyErr_SetString(PyExc_NotImplementedError, "__del__");
21146  return -1;
21147  }
21148 }
21149 
21150 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, CYTHON_UNUSED void *x) {
21151  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(o);
21152 }
21153 
21154 static int __pyx_setprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21155  if (v) {
21156  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(o, v);
21157  }
21158  else {
21159  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(o);
21160  }
21161 }
21162 
21163 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_name(PyObject *o, CYTHON_UNUSED void *x) {
21164  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(o);
21165 }
21166 
21167 static int __pyx_setprop_18BoundaryConditions_7BC_Base_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21168  if (v) {
21169  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(o, v);
21170  }
21171  else {
21172  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(o);
21173  }
21174 }
21175 
21176 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, CYTHON_UNUSED void *x) {
21177  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(o);
21178 }
21179 
21180 static int __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21181  if (v) {
21182  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(o, v);
21183  }
21184  else {
21185  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(o);
21186  }
21187 }
21188 
21189 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, CYTHON_UNUSED void *x) {
21190  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(o);
21191 }
21192 
21193 static int __pyx_setprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21194  if (v) {
21195  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(o, v);
21196  }
21197  else {
21198  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(o);
21199  }
21200 }
21201 
21202 static PyMethodDef __pyx_methods_18BoundaryConditions_BC_Base[] = {
21203  {"getContext", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext},
21204  {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, 0},
21205  {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, 0},
21206  {0, 0, 0, 0}
21207 };
21208 
21209 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BC_Base[] = {
21210  {(char *)"nd", __pyx_getprop_18BoundaryConditions_7BC_Base_nd, __pyx_setprop_18BoundaryConditions_7BC_Base_nd, (char *)0, 0},
21211  {(char *)"Shape", __pyx_getprop_18BoundaryConditions_7BC_Base_Shape, __pyx_setprop_18BoundaryConditions_7BC_Base_Shape, (char *)0, 0},
21212  {(char *)"name", __pyx_getprop_18BoundaryConditions_7BC_Base_name, __pyx_setprop_18BoundaryConditions_7BC_Base_name, (char *)0, 0},
21213  {(char *)"BC_type", __pyx_getprop_18BoundaryConditions_7BC_Base_BC_type, __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type, (char *)0, 0},
21214  {(char *)"ct", __pyx_getprop_18BoundaryConditions_7BC_Base_ct, __pyx_setprop_18BoundaryConditions_7BC_Base_ct, (char *)0, 0},
21215  {0, 0, 0, 0, 0}
21216 };
21217 
21218 static PyTypeObject __pyx_type_18BoundaryConditions_BC_Base = {
21219  PyVarObject_HEAD_INIT(0, 0)
21220  "BoundaryConditions.BC_Base", /*tp_name*/
21221  sizeof(struct __pyx_obj_18BoundaryConditions_BC_Base), /*tp_basicsize*/
21222  0, /*tp_itemsize*/
21223  __pyx_tp_dealloc_18BoundaryConditions_BC_Base, /*tp_dealloc*/
21224  0, /*tp_print*/
21225  0, /*tp_getattr*/
21226  0, /*tp_setattr*/
21227  #if PY_MAJOR_VERSION < 3
21228  0, /*tp_compare*/
21229  #endif
21230  #if PY_MAJOR_VERSION >= 3
21231  0, /*tp_as_async*/
21232  #endif
21233  0, /*tp_repr*/
21234  0, /*tp_as_number*/
21235  0, /*tp_as_sequence*/
21236  0, /*tp_as_mapping*/
21237  0, /*tp_hash*/
21238  0, /*tp_call*/
21239  0, /*tp_str*/
21240  0, /*tp_getattro*/
21241  0, /*tp_setattro*/
21242  0, /*tp_as_buffer*/
21243  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21244  "\n Generic class regrouping boundary conditions\n ", /*tp_doc*/
21245  __pyx_tp_traverse_18BoundaryConditions_BC_Base, /*tp_traverse*/
21246  __pyx_tp_clear_18BoundaryConditions_BC_Base, /*tp_clear*/
21247  0, /*tp_richcompare*/
21248  0, /*tp_weaklistoffset*/
21249  0, /*tp_iter*/
21250  0, /*tp_iternext*/
21251  __pyx_methods_18BoundaryConditions_BC_Base, /*tp_methods*/
21252  0, /*tp_members*/
21253  __pyx_getsets_18BoundaryConditions_BC_Base, /*tp_getset*/
21254  0, /*tp_base*/
21255  0, /*tp_dict*/
21256  0, /*tp_descr_get*/
21257  0, /*tp_descr_set*/
21258  0, /*tp_dictoffset*/
21259  __pyx_pw_18BoundaryConditions_7BC_Base_1__init__, /*tp_init*/
21260  0, /*tp_alloc*/
21261  __pyx_tp_new_18BoundaryConditions_BC_Base, /*tp_new*/
21262  0, /*tp_free*/
21263  0, /*tp_is_gc*/
21264  0, /*tp_bases*/
21265  0, /*tp_mro*/
21266  0, /*tp_cache*/
21267  0, /*tp_subclasses*/
21268  0, /*tp_weaklist*/
21269  0, /*tp_del*/
21270  0, /*tp_version_tag*/
21271  #if PY_VERSION_HEX >= 0x030400a1
21272  0, /*tp_finalize*/
21273  #endif
21274 };
21275 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition __pyx_vtable_18BoundaryConditions_BoundaryCondition;
21276 
21277 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21278  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p;
21279  PyObject *o;
21280  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21281  o = (*t->tp_alloc)(t, 0);
21282  } else {
21283  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21284  }
21285  if (unlikely(!o)) return 0;
21286  p = ((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o);
21287  p->__pyx_vtab = __pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
21288  p->uOfXT = Py_None; Py_INCREF(Py_None);
21289  return o;
21290 }
21291 
21292 static void __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21293  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21294  #if CYTHON_USE_TP_FINALIZE
21295  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21296  if (PyObject_CallFinalizerFromDealloc(o)) return;
21297  }
21298  #endif
21299  PyObject_GC_UnTrack(o);
21300  Py_CLEAR(p->uOfXT);
21301  (*Py_TYPE(o)->tp_free)(o);
21302 }
21303 
21304 static int __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition(PyObject *o, visitproc v, void *a) {
21305  int e;
21306  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21307  if (p->uOfXT) {
21308  e = (*v)(p->uOfXT, a); if (e) return e;
21309  }
21310  return 0;
21311 }
21312 
21313 static int __pyx_tp_clear_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21314  PyObject* tmp;
21315  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21316  tmp = ((PyObject*)p->uOfXT);
21317  p->uOfXT = Py_None; Py_INCREF(Py_None);
21318  Py_XDECREF(tmp);
21319  return 0;
21320 }
21321 
21322 static PyObject *__pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, CYTHON_UNUSED void *x) {
21323  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(o);
21324 }
21325 
21326 static int __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21327  if (v) {
21328  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(o, v);
21329  }
21330  else {
21331  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(o);
21332  }
21333 }
21334 
21335 static PyMethodDef __pyx_methods_18BoundaryConditions_BoundaryCondition[] = {
21336  {"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, 0},
21337  {"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC},
21338  {"setLinearBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC},
21339  {"setLinearRamp", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp},
21340  {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, 0},
21341  {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, 0},
21342  {0, 0, 0, 0}
21343 };
21344 
21345 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BoundaryCondition[] = {
21346  {(char *)"uOfXT", __pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT, __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT, (char *)0, 0},
21347  {0, 0, 0, 0, 0}
21348 };
21349 
21350 static PyTypeObject __pyx_type_18BoundaryConditions_BoundaryCondition = {
21351  PyVarObject_HEAD_INIT(0, 0)
21352  "BoundaryConditions.BoundaryCondition", /*tp_name*/
21353  sizeof(struct __pyx_obj_18BoundaryConditions_BoundaryCondition), /*tp_basicsize*/
21354  0, /*tp_itemsize*/
21355  __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition, /*tp_dealloc*/
21356  0, /*tp_print*/
21357  0, /*tp_getattr*/
21358  0, /*tp_setattr*/
21359  #if PY_MAJOR_VERSION < 3
21360  0, /*tp_compare*/
21361  #endif
21362  #if PY_MAJOR_VERSION >= 3
21363  0, /*tp_as_async*/
21364  #endif
21365  0, /*tp_repr*/
21366  0, /*tp_as_number*/
21367  0, /*tp_as_sequence*/
21368  0, /*tp_as_mapping*/
21369  0, /*tp_hash*/
21370  0, /*tp_call*/
21371  0, /*tp_str*/
21372  0, /*tp_getattro*/
21373  0, /*tp_setattro*/
21374  0, /*tp_as_buffer*/
21375  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21376  "\n Boundary condition class\n\n Attributes\n ----------\n uOfXT: func or None\n boundary condition function of x (array_like) and t (float) or None for\n no boundary condition\n ", /*tp_doc*/
21377  __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition, /*tp_traverse*/
21378  __pyx_tp_clear_18BoundaryConditions_BoundaryCondition, /*tp_clear*/
21379  0, /*tp_richcompare*/
21380  0, /*tp_weaklistoffset*/
21381  0, /*tp_iter*/
21382  0, /*tp_iternext*/
21383  __pyx_methods_18BoundaryConditions_BoundaryCondition, /*tp_methods*/
21384  0, /*tp_members*/
21385  __pyx_getsets_18BoundaryConditions_BoundaryCondition, /*tp_getset*/
21386  0, /*tp_base*/
21387  0, /*tp_dict*/
21388  0, /*tp_descr_get*/
21389  0, /*tp_descr_set*/
21390  0, /*tp_dictoffset*/
21391  __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__, /*tp_init*/
21392  0, /*tp_alloc*/
21393  __pyx_tp_new_18BoundaryConditions_BoundaryCondition, /*tp_new*/
21394  0, /*tp_free*/
21395  0, /*tp_is_gc*/
21396  0, /*tp_bases*/
21397  0, /*tp_mro*/
21398  0, /*tp_cache*/
21399  0, /*tp_subclasses*/
21400  0, /*tp_weaklist*/
21401  0, /*tp_del*/
21402  0, /*tp_version_tag*/
21403  #if PY_VERSION_HEX >= 0x030400a1
21404  0, /*tp_finalize*/
21405  #endif
21406 };
21407 
21408 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[8];
21409 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
21410 
21411 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21412  PyObject *o;
21413  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21414  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC];
21415  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC));
21416  (void) PyObject_INIT(o, t);
21417  PyObject_GC_Track(o);
21418  } else {
21419  o = (*t->tp_alloc)(t, 0);
21420  if (unlikely(!o)) return 0;
21421  }
21422  return o;
21423 }
21424 
21425 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21426  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21427  PyObject_GC_UnTrack(o);
21428  Py_CLEAR(p->__pyx_v_value);
21429  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21430  __pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o);
21431  } else {
21432  (*Py_TYPE(o)->tp_free)(o);
21433  }
21434 }
21435 
21436 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o, visitproc v, void *a) {
21437  int e;
21438  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21439  if (p->__pyx_v_value) {
21440  e = (*v)(p->__pyx_v_value, a); if (e) return e;
21441  }
21442  return 0;
21443 }
21444 
21445 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21446  PyObject* tmp;
21447  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21448  tmp = ((PyObject*)p->__pyx_v_value);
21449  p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
21450  Py_XDECREF(tmp);
21451  return 0;
21452 }
21453 
21454 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC = {
21455  PyVarObject_HEAD_INIT(0, 0)
21456  "BoundaryConditions.__pyx_scope_struct__setConstantBC", /*tp_name*/
21457  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC), /*tp_basicsize*/
21458  0, /*tp_itemsize*/
21459  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_dealloc*/
21460  0, /*tp_print*/
21461  0, /*tp_getattr*/
21462  0, /*tp_setattr*/
21463  #if PY_MAJOR_VERSION < 3
21464  0, /*tp_compare*/
21465  #endif
21466  #if PY_MAJOR_VERSION >= 3
21467  0, /*tp_as_async*/
21468  #endif
21469  0, /*tp_repr*/
21470  0, /*tp_as_number*/
21471  0, /*tp_as_sequence*/
21472  0, /*tp_as_mapping*/
21473  0, /*tp_hash*/
21474  0, /*tp_call*/
21475  0, /*tp_str*/
21476  0, /*tp_getattro*/
21477  0, /*tp_setattro*/
21478  0, /*tp_as_buffer*/
21479  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21480  0, /*tp_doc*/
21481  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_traverse*/
21482  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_clear*/
21483  0, /*tp_richcompare*/
21484  0, /*tp_weaklistoffset*/
21485  0, /*tp_iter*/
21486  0, /*tp_iternext*/
21487  0, /*tp_methods*/
21488  0, /*tp_members*/
21489  0, /*tp_getset*/
21490  0, /*tp_base*/
21491  0, /*tp_dict*/
21492  0, /*tp_descr_get*/
21493  0, /*tp_descr_set*/
21494  0, /*tp_dictoffset*/
21495  0, /*tp_init*/
21496  0, /*tp_alloc*/
21497  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_new*/
21498  0, /*tp_free*/
21499  0, /*tp_is_gc*/
21500  0, /*tp_bases*/
21501  0, /*tp_mro*/
21502  0, /*tp_cache*/
21503  0, /*tp_subclasses*/
21504  0, /*tp_weaklist*/
21505  0, /*tp_del*/
21506  0, /*tp_version_tag*/
21507  #if PY_VERSION_HEX >= 0x030400a1
21508  0, /*tp_finalize*/
21509  #endif
21510 };
21511 
21512 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[8];
21513 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
21514 
21515 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21516  PyObject *o;
21517  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21518  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC];
21519  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC));
21520  (void) PyObject_INIT(o, t);
21521  PyObject_GC_Track(o);
21522  } else {
21523  o = (*t->tp_alloc)(t, 0);
21524  if (unlikely(!o)) return 0;
21525  }
21526  return o;
21527 }
21528 
21529 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21530  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21531  PyObject_GC_UnTrack(o);
21532  Py_CLEAR(p->__pyx_v_a);
21533  Py_CLEAR(p->__pyx_v_a0);
21534  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21535  __pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o);
21536  } else {
21537  (*Py_TYPE(o)->tp_free)(o);
21538  }
21539 }
21540 
21541 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o, visitproc v, void *a) {
21542  int e;
21543  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21544  if (p->__pyx_v_a) {
21545  e = (*v)(p->__pyx_v_a, a); if (e) return e;
21546  }
21547  if (p->__pyx_v_a0) {
21548  e = (*v)(p->__pyx_v_a0, a); if (e) return e;
21549  }
21550  return 0;
21551 }
21552 
21553 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21554  PyObject* tmp;
21555  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21556  tmp = ((PyObject*)p->__pyx_v_a);
21557  p->__pyx_v_a = Py_None; Py_INCREF(Py_None);
21558  Py_XDECREF(tmp);
21559  tmp = ((PyObject*)p->__pyx_v_a0);
21560  p->__pyx_v_a0 = Py_None; Py_INCREF(Py_None);
21561  Py_XDECREF(tmp);
21562  return 0;
21563 }
21564 
21565 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = {
21566  PyVarObject_HEAD_INIT(0, 0)
21567  "BoundaryConditions.__pyx_scope_struct_1_setLinearBC", /*tp_name*/
21568  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC), /*tp_basicsize*/
21569  0, /*tp_itemsize*/
21570  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_dealloc*/
21571  0, /*tp_print*/
21572  0, /*tp_getattr*/
21573  0, /*tp_setattr*/
21574  #if PY_MAJOR_VERSION < 3
21575  0, /*tp_compare*/
21576  #endif
21577  #if PY_MAJOR_VERSION >= 3
21578  0, /*tp_as_async*/
21579  #endif
21580  0, /*tp_repr*/
21581  0, /*tp_as_number*/
21582  0, /*tp_as_sequence*/
21583  0, /*tp_as_mapping*/
21584  0, /*tp_hash*/
21585  0, /*tp_call*/
21586  0, /*tp_str*/
21587  0, /*tp_getattro*/
21588  0, /*tp_setattro*/
21589  0, /*tp_as_buffer*/
21590  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21591  0, /*tp_doc*/
21592  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_traverse*/
21593  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_clear*/
21594  0, /*tp_richcompare*/
21595  0, /*tp_weaklistoffset*/
21596  0, /*tp_iter*/
21597  0, /*tp_iternext*/
21598  0, /*tp_methods*/
21599  0, /*tp_members*/
21600  0, /*tp_getset*/
21601  0, /*tp_base*/
21602  0, /*tp_dict*/
21603  0, /*tp_descr_get*/
21604  0, /*tp_descr_set*/
21605  0, /*tp_dictoffset*/
21606  0, /*tp_init*/
21607  0, /*tp_alloc*/
21608  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_new*/
21609  0, /*tp_free*/
21610  0, /*tp_is_gc*/
21611  0, /*tp_bases*/
21612  0, /*tp_mro*/
21613  0, /*tp_cache*/
21614  0, /*tp_subclasses*/
21615  0, /*tp_weaklist*/
21616  0, /*tp_del*/
21617  0, /*tp_version_tag*/
21618  #if PY_VERSION_HEX >= 0x030400a1
21619  0, /*tp_finalize*/
21620  #endif
21621 };
21622 
21623 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[8];
21624 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
21625 
21626 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21627  PyObject *o;
21628  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
21629  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp];
21630  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp));
21631  (void) PyObject_INIT(o, t);
21632  PyObject_GC_Track(o);
21633  } else {
21634  o = (*t->tp_alloc)(t, 0);
21635  if (unlikely(!o)) return 0;
21636  }
21637  return o;
21638 }
21639 
21640 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
21641  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21642  PyObject_GC_UnTrack(o);
21643  Py_CLEAR(p->__pyx_v_t1);
21644  Py_CLEAR(p->__pyx_v_value);
21645  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
21646  __pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o);
21647  } else {
21648  (*Py_TYPE(o)->tp_free)(o);
21649  }
21650 }
21651 
21652 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o, visitproc v, void *a) {
21653  int e;
21654  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21655  if (p->__pyx_v_t1) {
21656  e = (*v)(p->__pyx_v_t1, a); if (e) return e;
21657  }
21658  if (p->__pyx_v_value) {
21659  e = (*v)(p->__pyx_v_value, a); if (e) return e;
21660  }
21661  return 0;
21662 }
21663 
21664 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
21665  PyObject* tmp;
21666  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21667  tmp = ((PyObject*)p->__pyx_v_t1);
21668  p->__pyx_v_t1 = Py_None; Py_INCREF(Py_None);
21669  Py_XDECREF(tmp);
21670  tmp = ((PyObject*)p->__pyx_v_value);
21671  p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
21672  Py_XDECREF(tmp);
21673  return 0;
21674 }
21675 
21676 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = {
21677  PyVarObject_HEAD_INIT(0, 0)
21678  "BoundaryConditions.__pyx_scope_struct_2_setLinearRamp", /*tp_name*/
21679  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp), /*tp_basicsize*/
21680  0, /*tp_itemsize*/
21681  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_dealloc*/
21682  0, /*tp_print*/
21683  0, /*tp_getattr*/
21684  0, /*tp_setattr*/
21685  #if PY_MAJOR_VERSION < 3
21686  0, /*tp_compare*/
21687  #endif
21688  #if PY_MAJOR_VERSION >= 3
21689  0, /*tp_as_async*/
21690  #endif
21691  0, /*tp_repr*/
21692  0, /*tp_as_number*/
21693  0, /*tp_as_sequence*/
21694  0, /*tp_as_mapping*/
21695  0, /*tp_hash*/
21696  0, /*tp_call*/
21697  0, /*tp_str*/
21698  0, /*tp_getattro*/
21699  0, /*tp_setattro*/
21700  0, /*tp_as_buffer*/
21701  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21702  0, /*tp_doc*/
21703  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_traverse*/
21704  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_clear*/
21705  0, /*tp_richcompare*/
21706  0, /*tp_weaklistoffset*/
21707  0, /*tp_iter*/
21708  0, /*tp_iternext*/
21709  0, /*tp_methods*/
21710  0, /*tp_members*/
21711  0, /*tp_getset*/
21712  0, /*tp_base*/
21713  0, /*tp_dict*/
21714  0, /*tp_descr_get*/
21715  0, /*tp_descr_set*/
21716  0, /*tp_dictoffset*/
21717  0, /*tp_init*/
21718  0, /*tp_alloc*/
21719  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_new*/
21720  0, /*tp_free*/
21721  0, /*tp_is_gc*/
21722  0, /*tp_bases*/
21723  0, /*tp_mro*/
21724  0, /*tp_cache*/
21725  0, /*tp_subclasses*/
21726  0, /*tp_weaklist*/
21727  0, /*tp_del*/
21728  0, /*tp_version_tag*/
21729  #if PY_VERSION_HEX >= 0x030400a1
21730  0, /*tp_finalize*/
21731  #endif
21732 };
21733 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21734 
21735 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21736  struct __pyx_array_obj *p;
21737  PyObject *o;
21738  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21739  o = (*t->tp_alloc)(t, 0);
21740  } else {
21741  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21742  }
21743  if (unlikely(!o)) return 0;
21744  p = ((struct __pyx_array_obj *)o);
21745  p->__pyx_vtab = __pyx_vtabptr_array;
21746  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21747  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21748  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
21749  return o;
21750  bad:
21751  Py_DECREF(o); o = 0;
21752  return NULL;
21753 }
21754 
21755 static void __pyx_tp_dealloc_array(PyObject *o) {
21756  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
21757  #if CYTHON_USE_TP_FINALIZE
21758  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21759  if (PyObject_CallFinalizerFromDealloc(o)) return;
21760  }
21761  #endif
21762  {
21763  PyObject *etype, *eval, *etb;
21764  PyErr_Fetch(&etype, &eval, &etb);
21765  ++Py_REFCNT(o);
21766  __pyx_array___dealloc__(o);
21767  --Py_REFCNT(o);
21768  PyErr_Restore(etype, eval, etb);
21769  }
21770  Py_CLEAR(p->mode);
21771  Py_CLEAR(p->_format);
21772  (*Py_TYPE(o)->tp_free)(o);
21773 }
21774 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21775  PyObject *r;
21776  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21777  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21778  Py_DECREF(x);
21779  return r;
21780 }
21781 
21782 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21783  if (v) {
21784  return __pyx_array___setitem__(o, i, v);
21785  }
21786  else {
21787  PyErr_Format(PyExc_NotImplementedError,
21788  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21789  return -1;
21790  }
21791 }
21792 
21793 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21794  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21795  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21796  PyErr_Clear();
21797  v = __pyx_array___getattr__(o, n);
21798  }
21799  return v;
21800 }
21801 
21802 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
21803  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21804 }
21805 
21806 static PyMethodDef __pyx_methods_array[] = {
21807  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21808  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21809  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21810  {0, 0, 0, 0}
21811 };
21812 
21813 static struct PyGetSetDef __pyx_getsets_array[] = {
21814  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
21815  {0, 0, 0, 0, 0}
21816 };
21817 
21818 static PySequenceMethods __pyx_tp_as_sequence_array = {
21819  __pyx_array___len__, /*sq_length*/
21820  0, /*sq_concat*/
21821  0, /*sq_repeat*/
21822  __pyx_sq_item_array, /*sq_item*/
21823  0, /*sq_slice*/
21824  0, /*sq_ass_item*/
21825  0, /*sq_ass_slice*/
21826  0, /*sq_contains*/
21827  0, /*sq_inplace_concat*/
21828  0, /*sq_inplace_repeat*/
21829 };
21830 
21831 static PyMappingMethods __pyx_tp_as_mapping_array = {
21832  __pyx_array___len__, /*mp_length*/
21833  __pyx_array___getitem__, /*mp_subscript*/
21834  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
21835 };
21836 
21837 static PyBufferProcs __pyx_tp_as_buffer_array = {
21838  #if PY_MAJOR_VERSION < 3
21839  0, /*bf_getreadbuffer*/
21840  #endif
21841  #if PY_MAJOR_VERSION < 3
21842  0, /*bf_getwritebuffer*/
21843  #endif
21844  #if PY_MAJOR_VERSION < 3
21845  0, /*bf_getsegcount*/
21846  #endif
21847  #if PY_MAJOR_VERSION < 3
21848  0, /*bf_getcharbuffer*/
21849  #endif
21850  __pyx_array_getbuffer, /*bf_getbuffer*/
21851  0, /*bf_releasebuffer*/
21852 };
21853 
21854 static PyTypeObject __pyx_type___pyx_array = {
21855  PyVarObject_HEAD_INIT(0, 0)
21856  "BoundaryConditions.array", /*tp_name*/
21857  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
21858  0, /*tp_itemsize*/
21859  __pyx_tp_dealloc_array, /*tp_dealloc*/
21860  0, /*tp_print*/
21861  0, /*tp_getattr*/
21862  0, /*tp_setattr*/
21863  #if PY_MAJOR_VERSION < 3
21864  0, /*tp_compare*/
21865  #endif
21866  #if PY_MAJOR_VERSION >= 3
21867  0, /*tp_as_async*/
21868  #endif
21869  0, /*tp_repr*/
21870  0, /*tp_as_number*/
21871  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
21872  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
21873  0, /*tp_hash*/
21874  0, /*tp_call*/
21875  0, /*tp_str*/
21876  __pyx_tp_getattro_array, /*tp_getattro*/
21877  0, /*tp_setattro*/
21878  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
21879  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21880  0, /*tp_doc*/
21881  0, /*tp_traverse*/
21882  0, /*tp_clear*/
21883  0, /*tp_richcompare*/
21884  0, /*tp_weaklistoffset*/
21885  0, /*tp_iter*/
21886  0, /*tp_iternext*/
21887  __pyx_methods_array, /*tp_methods*/
21888  0, /*tp_members*/
21889  __pyx_getsets_array, /*tp_getset*/
21890  0, /*tp_base*/
21891  0, /*tp_dict*/
21892  0, /*tp_descr_get*/
21893  0, /*tp_descr_set*/
21894  0, /*tp_dictoffset*/
21895  0, /*tp_init*/
21896  0, /*tp_alloc*/
21897  __pyx_tp_new_array, /*tp_new*/
21898  0, /*tp_free*/
21899  0, /*tp_is_gc*/
21900  0, /*tp_bases*/
21901  0, /*tp_mro*/
21902  0, /*tp_cache*/
21903  0, /*tp_subclasses*/
21904  0, /*tp_weaklist*/
21905  0, /*tp_del*/
21906  0, /*tp_version_tag*/
21907  #if PY_VERSION_HEX >= 0x030400a1
21908  0, /*tp_finalize*/
21909  #endif
21910 };
21911 
21912 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21913  struct __pyx_MemviewEnum_obj *p;
21914  PyObject *o;
21915  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21916  o = (*t->tp_alloc)(t, 0);
21917  } else {
21918  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21919  }
21920  if (unlikely(!o)) return 0;
21921  p = ((struct __pyx_MemviewEnum_obj *)o);
21922  p->name = Py_None; Py_INCREF(Py_None);
21923  return o;
21924 }
21925 
21926 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21927  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21928  #if CYTHON_USE_TP_FINALIZE
21929  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21930  if (PyObject_CallFinalizerFromDealloc(o)) return;
21931  }
21932  #endif
21933  PyObject_GC_UnTrack(o);
21934  Py_CLEAR(p->name);
21935  (*Py_TYPE(o)->tp_free)(o);
21936 }
21937 
21938 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
21939  int e;
21940  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21941  if (p->name) {
21942  e = (*v)(p->name, a); if (e) return e;
21943  }
21944  return 0;
21945 }
21946 
21947 static int __pyx_tp_clear_Enum(PyObject *o) {
21948  PyObject* tmp;
21949  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21950  tmp = ((PyObject*)p->name);
21951  p->name = Py_None; Py_INCREF(Py_None);
21952  Py_XDECREF(tmp);
21953  return 0;
21954 }
21955 
21956 static PyMethodDef __pyx_methods_Enum[] = {
21957  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21958  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21959  {0, 0, 0, 0}
21960 };
21961 
21962 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21963  PyVarObject_HEAD_INIT(0, 0)
21964  "BoundaryConditions.Enum", /*tp_name*/
21965  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
21966  0, /*tp_itemsize*/
21967  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
21968  0, /*tp_print*/
21969  0, /*tp_getattr*/
21970  0, /*tp_setattr*/
21971  #if PY_MAJOR_VERSION < 3
21972  0, /*tp_compare*/
21973  #endif
21974  #if PY_MAJOR_VERSION >= 3
21975  0, /*tp_as_async*/
21976  #endif
21977  __pyx_MemviewEnum___repr__, /*tp_repr*/
21978  0, /*tp_as_number*/
21979  0, /*tp_as_sequence*/
21980  0, /*tp_as_mapping*/
21981  0, /*tp_hash*/
21982  0, /*tp_call*/
21983  0, /*tp_str*/
21984  0, /*tp_getattro*/
21985  0, /*tp_setattro*/
21986  0, /*tp_as_buffer*/
21987  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21988  0, /*tp_doc*/
21989  __pyx_tp_traverse_Enum, /*tp_traverse*/
21990  __pyx_tp_clear_Enum, /*tp_clear*/
21991  0, /*tp_richcompare*/
21992  0, /*tp_weaklistoffset*/
21993  0, /*tp_iter*/
21994  0, /*tp_iternext*/
21995  __pyx_methods_Enum, /*tp_methods*/
21996  0, /*tp_members*/
21997  0, /*tp_getset*/
21998  0, /*tp_base*/
21999  0, /*tp_dict*/
22000  0, /*tp_descr_get*/
22001  0, /*tp_descr_set*/
22002  0, /*tp_dictoffset*/
22003  __pyx_MemviewEnum___init__, /*tp_init*/
22004  0, /*tp_alloc*/
22005  __pyx_tp_new_Enum, /*tp_new*/
22006  0, /*tp_free*/
22007  0, /*tp_is_gc*/
22008  0, /*tp_bases*/
22009  0, /*tp_mro*/
22010  0, /*tp_cache*/
22011  0, /*tp_subclasses*/
22012  0, /*tp_weaklist*/
22013  0, /*tp_del*/
22014  0, /*tp_version_tag*/
22015  #if PY_VERSION_HEX >= 0x030400a1
22016  0, /*tp_finalize*/
22017  #endif
22018 };
22019 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22020 
22021 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22022  struct __pyx_memoryview_obj *p;
22023  PyObject *o;
22024  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22025  o = (*t->tp_alloc)(t, 0);
22026  } else {
22027  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22028  }
22029  if (unlikely(!o)) return 0;
22030  p = ((struct __pyx_memoryview_obj *)o);
22031  p->__pyx_vtab = __pyx_vtabptr_memoryview;
22032  p->obj = Py_None; Py_INCREF(Py_None);
22033  p->_size = Py_None; Py_INCREF(Py_None);
22034  p->_array_interface = Py_None; Py_INCREF(Py_None);
22035  p->view.obj = NULL;
22036  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
22037  return o;
22038  bad:
22039  Py_DECREF(o); o = 0;
22040  return NULL;
22041 }
22042 
22043 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22044  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22045  #if CYTHON_USE_TP_FINALIZE
22046  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22047  if (PyObject_CallFinalizerFromDealloc(o)) return;
22048  }
22049  #endif
22050  PyObject_GC_UnTrack(o);
22051  {
22052  PyObject *etype, *eval, *etb;
22053  PyErr_Fetch(&etype, &eval, &etb);
22054  ++Py_REFCNT(o);
22055  __pyx_memoryview___dealloc__(o);
22056  --Py_REFCNT(o);
22057  PyErr_Restore(etype, eval, etb);
22058  }
22059  Py_CLEAR(p->obj);
22060  Py_CLEAR(p->_size);
22061  Py_CLEAR(p->_array_interface);
22062  (*Py_TYPE(o)->tp_free)(o);
22063 }
22064 
22065 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
22066  int e;
22067  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22068  if (p->obj) {
22069  e = (*v)(p->obj, a); if (e) return e;
22070  }
22071  if (p->_size) {
22072  e = (*v)(p->_size, a); if (e) return e;
22073  }
22074  if (p->_array_interface) {
22075  e = (*v)(p->_array_interface, a); if (e) return e;
22076  }
22077  if (p->view.obj) {
22078  e = (*v)(p->view.obj, a); if (e) return e;
22079  }
22080  return 0;
22081 }
22082 
22083 static int __pyx_tp_clear_memoryview(PyObject *o) {
22084  PyObject* tmp;
22085  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22086  tmp = ((PyObject*)p->obj);
22087  p->obj = Py_None; Py_INCREF(Py_None);
22088  Py_XDECREF(tmp);
22089  tmp = ((PyObject*)p->_size);
22090  p->_size = Py_None; Py_INCREF(Py_None);
22091  Py_XDECREF(tmp);
22092  tmp = ((PyObject*)p->_array_interface);
22093  p->_array_interface = Py_None; Py_INCREF(Py_None);
22094  Py_XDECREF(tmp);
22095  Py_CLEAR(p->view.obj);
22096  return 0;
22097 }
22098 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22099  PyObject *r;
22100  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22101  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22102  Py_DECREF(x);
22103  return r;
22104 }
22105 
22106 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
22107  if (v) {
22108  return __pyx_memoryview___setitem__(o, i, v);
22109  }
22110  else {
22111  PyErr_Format(PyExc_NotImplementedError,
22112  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22113  return -1;
22114  }
22115 }
22116 
22117 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
22118  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22119 }
22120 
22121 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
22122  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22123 }
22124 
22125 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
22126  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22127 }
22128 
22129 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
22130  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22131 }
22132 
22133 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
22134  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22135 }
22136 
22137 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
22138  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22139 }
22140 
22141 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
22142  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22143 }
22144 
22145 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
22146  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22147 }
22148 
22149 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
22150  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22151 }
22152 
22153 static PyMethodDef __pyx_methods_memoryview[] = {
22154  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22155  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22156  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22157  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22158  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22159  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22160  {0, 0, 0, 0}
22161 };
22162 
22163 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22164  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
22165  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
22166  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
22167  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
22168  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
22169  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
22170  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
22171  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
22172  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
22173  {0, 0, 0, 0, 0}
22174 };
22175 
22176 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22177  __pyx_memoryview___len__, /*sq_length*/
22178  0, /*sq_concat*/
22179  0, /*sq_repeat*/
22180  __pyx_sq_item_memoryview, /*sq_item*/
22181  0, /*sq_slice*/
22182  0, /*sq_ass_item*/
22183  0, /*sq_ass_slice*/
22184  0, /*sq_contains*/
22185  0, /*sq_inplace_concat*/
22186  0, /*sq_inplace_repeat*/
22187 };
22188 
22189 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22190  __pyx_memoryview___len__, /*mp_length*/
22191  __pyx_memoryview___getitem__, /*mp_subscript*/
22192  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
22193 };
22194 
22195 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22196  #if PY_MAJOR_VERSION < 3
22197  0, /*bf_getreadbuffer*/
22198  #endif
22199  #if PY_MAJOR_VERSION < 3
22200  0, /*bf_getwritebuffer*/
22201  #endif
22202  #if PY_MAJOR_VERSION < 3
22203  0, /*bf_getsegcount*/
22204  #endif
22205  #if PY_MAJOR_VERSION < 3
22206  0, /*bf_getcharbuffer*/
22207  #endif
22208  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
22209  0, /*bf_releasebuffer*/
22210 };
22211 
22212 static PyTypeObject __pyx_type___pyx_memoryview = {
22213  PyVarObject_HEAD_INIT(0, 0)
22214  "BoundaryConditions.memoryview", /*tp_name*/
22215  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
22216  0, /*tp_itemsize*/
22217  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
22218  0, /*tp_print*/
22219  0, /*tp_getattr*/
22220  0, /*tp_setattr*/
22221  #if PY_MAJOR_VERSION < 3
22222  0, /*tp_compare*/
22223  #endif
22224  #if PY_MAJOR_VERSION >= 3
22225  0, /*tp_as_async*/
22226  #endif
22227  __pyx_memoryview___repr__, /*tp_repr*/
22228  0, /*tp_as_number*/
22229  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
22230  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
22231  0, /*tp_hash*/
22232  0, /*tp_call*/
22233  __pyx_memoryview___str__, /*tp_str*/
22234  0, /*tp_getattro*/
22235  0, /*tp_setattro*/
22236  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
22237  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22238  0, /*tp_doc*/
22239  __pyx_tp_traverse_memoryview, /*tp_traverse*/
22240  __pyx_tp_clear_memoryview, /*tp_clear*/
22241  0, /*tp_richcompare*/
22242  0, /*tp_weaklistoffset*/
22243  0, /*tp_iter*/
22244  0, /*tp_iternext*/
22245  __pyx_methods_memoryview, /*tp_methods*/
22246  0, /*tp_members*/
22247  __pyx_getsets_memoryview, /*tp_getset*/
22248  0, /*tp_base*/
22249  0, /*tp_dict*/
22250  0, /*tp_descr_get*/
22251  0, /*tp_descr_set*/
22252  0, /*tp_dictoffset*/
22253  0, /*tp_init*/
22254  0, /*tp_alloc*/
22255  __pyx_tp_new_memoryview, /*tp_new*/
22256  0, /*tp_free*/
22257  0, /*tp_is_gc*/
22258  0, /*tp_bases*/
22259  0, /*tp_mro*/
22260  0, /*tp_cache*/
22261  0, /*tp_subclasses*/
22262  0, /*tp_weaklist*/
22263  0, /*tp_del*/
22264  0, /*tp_version_tag*/
22265  #if PY_VERSION_HEX >= 0x030400a1
22266  0, /*tp_finalize*/
22267  #endif
22268 };
22269 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22270 
22271 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22272  struct __pyx_memoryviewslice_obj *p;
22273  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22274  if (unlikely(!o)) return 0;
22275  p = ((struct __pyx_memoryviewslice_obj *)o);
22276  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22277  p->from_object = Py_None; Py_INCREF(Py_None);
22278  p->from_slice.memview = NULL;
22279  return o;
22280 }
22281 
22282 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22283  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22284  #if CYTHON_USE_TP_FINALIZE
22285  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22286  if (PyObject_CallFinalizerFromDealloc(o)) return;
22287  }
22288  #endif
22289  PyObject_GC_UnTrack(o);
22290  {
22291  PyObject *etype, *eval, *etb;
22292  PyErr_Fetch(&etype, &eval, &etb);
22293  ++Py_REFCNT(o);
22294  __pyx_memoryviewslice___dealloc__(o);
22295  --Py_REFCNT(o);
22296  PyErr_Restore(etype, eval, etb);
22297  }
22298  Py_CLEAR(p->from_object);
22299  PyObject_GC_Track(o);
22300  __pyx_tp_dealloc_memoryview(o);
22301 }
22302 
22303 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
22304  int e;
22305  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22306  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
22307  if (p->from_object) {
22308  e = (*v)(p->from_object, a); if (e) return e;
22309  }
22310  return 0;
22311 }
22312 
22313 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22314  PyObject* tmp;
22315  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22316  __pyx_tp_clear_memoryview(o);
22317  tmp = ((PyObject*)p->from_object);
22318  p->from_object = Py_None; Py_INCREF(Py_None);
22319  Py_XDECREF(tmp);
22320  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22321  return 0;
22322 }
22323 
22324 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
22325  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22326 }
22327 
22328 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22329  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22330  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22331  {0, 0, 0, 0}
22332 };
22333 
22334 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22335  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
22336  {0, 0, 0, 0, 0}
22337 };
22338 
22339 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22340  PyVarObject_HEAD_INIT(0, 0)
22341  "BoundaryConditions._memoryviewslice", /*tp_name*/
22342  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
22343  0, /*tp_itemsize*/
22344  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
22345  0, /*tp_print*/
22346  0, /*tp_getattr*/
22347  0, /*tp_setattr*/
22348  #if PY_MAJOR_VERSION < 3
22349  0, /*tp_compare*/
22350  #endif
22351  #if PY_MAJOR_VERSION >= 3
22352  0, /*tp_as_async*/
22353  #endif
22354  #if CYTHON_COMPILING_IN_PYPY
22355  __pyx_memoryview___repr__, /*tp_repr*/
22356  #else
22357  0, /*tp_repr*/
22358  #endif
22359  0, /*tp_as_number*/
22360  0, /*tp_as_sequence*/
22361  0, /*tp_as_mapping*/
22362  0, /*tp_hash*/
22363  0, /*tp_call*/
22364  #if CYTHON_COMPILING_IN_PYPY
22365  __pyx_memoryview___str__, /*tp_str*/
22366  #else
22367  0, /*tp_str*/
22368  #endif
22369  0, /*tp_getattro*/
22370  0, /*tp_setattro*/
22371  0, /*tp_as_buffer*/
22372  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22373  "Internal class for passing memoryview slices to Python", /*tp_doc*/
22374  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
22375  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
22376  0, /*tp_richcompare*/
22377  0, /*tp_weaklistoffset*/
22378  0, /*tp_iter*/
22379  0, /*tp_iternext*/
22380  __pyx_methods__memoryviewslice, /*tp_methods*/
22381  0, /*tp_members*/
22382  __pyx_getsets__memoryviewslice, /*tp_getset*/
22383  0, /*tp_base*/
22384  0, /*tp_dict*/
22385  0, /*tp_descr_get*/
22386  0, /*tp_descr_set*/
22387  0, /*tp_dictoffset*/
22388  0, /*tp_init*/
22389  0, /*tp_alloc*/
22390  __pyx_tp_new__memoryviewslice, /*tp_new*/
22391  0, /*tp_free*/
22392  0, /*tp_is_gc*/
22393  0, /*tp_bases*/
22394  0, /*tp_mro*/
22395  0, /*tp_cache*/
22396  0, /*tp_subclasses*/
22397  0, /*tp_weaklist*/
22398  0, /*tp_del*/
22399  0, /*tp_version_tag*/
22400  #if PY_VERSION_HEX >= 0x030400a1
22401  0, /*tp_finalize*/
22402  #endif
22403 };
22404 
22405 static PyMethodDef __pyx_methods[] = {
22406  {0, 0, 0, 0}
22407 };
22408 
22409 #if PY_MAJOR_VERSION >= 3
22410 #if CYTHON_PEP489_MULTI_PHASE_INIT
22411 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
22412 static int __pyx_pymod_exec_BoundaryConditions(PyObject* module); /*proto*/
22413 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22414  {Py_mod_create, (void*)__pyx_pymod_create},
22415  {Py_mod_exec, (void*)__pyx_pymod_exec_BoundaryConditions},
22416  {0, NULL}
22417 };
22418 #endif
22419 
22420 static struct PyModuleDef __pyx_moduledef = {
22421  PyModuleDef_HEAD_INIT,
22422  "BoundaryConditions",
22423  0, /* m_doc */
22424  #if CYTHON_PEP489_MULTI_PHASE_INIT
22425  0, /* m_size */
22426  #else
22427  -1, /* m_size */
22428  #endif
22429  __pyx_methods /* m_methods */,
22430  #if CYTHON_PEP489_MULTI_PHASE_INIT
22431  __pyx_moduledef_slots, /* m_slots */
22432  #else
22433  NULL, /* m_reload */
22434  #endif
22435  NULL, /* m_traverse */
22436  NULL, /* m_clear */
22437  NULL /* m_free */
22438 };
22439 #endif
22440 
22441 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22442  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22443  {&__pyx_n_s_BC_Base___reduce_cython, __pyx_k_BC_Base___reduce_cython, sizeof(__pyx_k_BC_Base___reduce_cython), 0, 0, 1, 1},
22444  {&__pyx_n_s_BC_Base___setstate_cython, __pyx_k_BC_Base___setstate_cython, sizeof(__pyx_k_BC_Base___setstate_cython), 0, 0, 1, 1},
22445  {&__pyx_n_s_BC_Base_getContext, __pyx_k_BC_Base_getContext, sizeof(__pyx_k_BC_Base_getContext), 0, 0, 1, 1},
22446  {&__pyx_n_s_BoundaryCondition___reduce_cytho, __pyx_k_BoundaryCondition___reduce_cytho, sizeof(__pyx_k_BoundaryCondition___reduce_cytho), 0, 0, 1, 1},
22447  {&__pyx_n_s_BoundaryCondition___setstate_cyt, __pyx_k_BoundaryCondition___setstate_cyt, sizeof(__pyx_k_BoundaryCondition___setstate_cyt), 0, 0, 1, 1},
22448  {&__pyx_n_s_BoundaryCondition_init_cython, __pyx_k_BoundaryCondition_init_cython, sizeof(__pyx_k_BoundaryCondition_init_cython), 0, 0, 1, 1},
22449  {&__pyx_n_s_BoundaryCondition_resetBC, __pyx_k_BoundaryCondition_resetBC, sizeof(__pyx_k_BoundaryCondition_resetBC), 0, 0, 1, 1},
22450  {&__pyx_n_s_BoundaryCondition_setConstantBC, __pyx_k_BoundaryCondition_setConstantBC, sizeof(__pyx_k_BoundaryCondition_setConstantBC), 0, 0, 1, 1},
22451  {&__pyx_n_s_BoundaryCondition_setLinearBC, __pyx_k_BoundaryCondition_setLinearBC, sizeof(__pyx_k_BoundaryCondition_setLinearBC), 0, 0, 1, 1},
22452  {&__pyx_n_s_BoundaryCondition_setLinearRamp, __pyx_k_BoundaryCondition_setLinearRamp, sizeof(__pyx_k_BoundaryCondition_setLinearRamp), 0, 0, 1, 1},
22453  {&__pyx_n_s_BoundaryConditions, __pyx_k_BoundaryConditions, sizeof(__pyx_k_BoundaryConditions), 0, 0, 1, 1},
22454  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22455  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22456  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22457  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22458  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22459  {&__pyx_n_s_Context, __pyx_k_Context, sizeof(__pyx_k_Context), 0, 0, 1, 1},
22460  {&__pyx_n_s_Domain, __pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 0, 1, 1},
22461  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22462  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22463  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
22464  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
22465  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22466  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_k_Incompatible_checksums_s_vs_0x96, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x96), 0, 0, 1, 0},
22467  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22468  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22469  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22470  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22471  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22472  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22473  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22474  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22475  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
22476  {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1},
22477  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22478  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22479  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22480  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
22481  {&__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC, __pyx_k_Shape_or_nd_must_be_passed_to_BC, sizeof(__pyx_k_Shape_or_nd_must_be_passed_to_BC), 0, 0, 1, 0},
22482  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22483  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22484  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22485  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22486  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
22487  {&__pyx_n_s_a0, __pyx_k_a0, sizeof(__pyx_k_a0), 0, 0, 1, 1},
22488  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22489  {&__pyx_n_s_b_i, __pyx_k_b_i, sizeof(__pyx_k_b_i), 0, 0, 1, 1},
22490  {&__pyx_n_s_b_or, __pyx_k_b_or, sizeof(__pyx_k_b_or), 0, 0, 1, 1},
22491  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22492  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22493  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22494  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22495  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22496  {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
22497  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22498  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22499  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22500  {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
22501  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22502  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22503  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22504  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22505  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22506  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22507  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22508  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22509  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
22510  {&__pyx_n_s_getContext, __pyx_k_getContext, sizeof(__pyx_k_getContext), 0, 0, 1, 1},
22511  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22512  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22513  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22514  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22515  {&__pyx_n_s_init_cython, __pyx_k_init_cython, sizeof(__pyx_k_init_cython), 0, 0, 1, 1},
22516  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22517  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22518  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22519  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22520  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22521  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22522  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22523  {&__pyx_n_s_nd, __pyx_k_nd, sizeof(__pyx_k_nd), 0, 0, 1, 1},
22524  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
22525  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
22526  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22527  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
22528  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22529  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22530  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22531  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
22532  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
22533  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22534  {&__pyx_n_s_proteus, __pyx_k_proteus, sizeof(__pyx_k_proteus), 0, 0, 1, 1},
22535  {&__pyx_kp_s_proteus_BoundaryConditions_py, __pyx_k_proteus_BoundaryConditions_py, sizeof(__pyx_k_proteus_BoundaryConditions_py), 0, 0, 1, 0},
22536  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22537  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22538  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22539  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22540  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22541  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22542  {&__pyx_n_s_pyx_unpickle_BC_Base, __pyx_k_pyx_unpickle_BC_Base, sizeof(__pyx_k_pyx_unpickle_BC_Base), 0, 0, 1, 1},
22543  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22544  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22545  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
22546  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22547  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22548  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22549  {&__pyx_n_s_resetBC, __pyx_k_resetBC, sizeof(__pyx_k_resetBC), 0, 0, 1, 1},
22550  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
22551  {&__pyx_kp_s_self_uuOfXT_cannot_be_converted, __pyx_k_self_uuOfXT_cannot_be_converted, sizeof(__pyx_k_self_uuOfXT_cannot_be_converted), 0, 0, 1, 0},
22552  {&__pyx_n_s_setConstantBC, __pyx_k_setConstantBC, sizeof(__pyx_k_setConstantBC), 0, 0, 1, 1},
22553  {&__pyx_n_s_setConstantBC_locals_lambda, __pyx_k_setConstantBC_locals_lambda, sizeof(__pyx_k_setConstantBC_locals_lambda), 0, 0, 1, 1},
22554  {&__pyx_n_s_setLinearBC, __pyx_k_setLinearBC, sizeof(__pyx_k_setLinearBC), 0, 0, 1, 1},
22555  {&__pyx_n_s_setLinearBC_locals_lambda, __pyx_k_setLinearBC_locals_lambda, sizeof(__pyx_k_setLinearBC_locals_lambda), 0, 0, 1, 1},
22556  {&__pyx_n_s_setLinearRamp, __pyx_k_setLinearRamp, sizeof(__pyx_k_setLinearRamp), 0, 0, 1, 1},
22557  {&__pyx_n_s_setLinearRamp_locals_lambda, __pyx_k_setLinearRamp_locals_lambda, sizeof(__pyx_k_setLinearRamp_locals_lambda), 0, 0, 1, 1},
22558  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22559  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22560  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
22561  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
22562  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
22563  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
22564  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
22565  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
22566  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22567  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22568  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22569  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22570  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
22571  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
22572  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
22573  {&__pyx_n_s_t1, __pyx_k_t1, sizeof(__pyx_k_t1), 0, 0, 1, 1},
22574  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
22575  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22576  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22577  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
22578  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22579  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
22580  {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
22581  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
22582  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
22583  {0, 0, 0, 0, 0, 0, 0}
22584 };
22585 static int __Pyx_InitCachedBuiltins(void) {
22586  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 102, __pyx_L1_error)
22587  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
22588  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 229, __pyx_L1_error)
22589  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(3, 242, __pyx_L1_error)
22590  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 810, __pyx_L1_error)
22591  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 1000, __pyx_L1_error)
22592  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 147, __pyx_L1_error)
22593  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 150, __pyx_L1_error)
22594  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 399, __pyx_L1_error)
22595  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 608, __pyx_L1_error)
22596  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 827, __pyx_L1_error)
22597  return 0;
22598  __pyx_L1_error:;
22599  return -1;
22600 }
22601 
22602 static int __Pyx_InitCachedConstants(void) {
22603  __Pyx_RefNannyDeclarations
22604  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
22605 
22606  /* "BoundaryConditions.py":102
22607  * """
22608  *
22609  * self.uOfXT = lambda x, t: a0+sum(a[:]*x[:]) # <<<<<<<<<<<<<<
22610  *
22611  * def setLinearRamp(self,t1,value):
22612  */
22613  __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 102, __pyx_L1_error)
22614  __Pyx_GOTREF(__pyx_slice_);
22615  __Pyx_GIVEREF(__pyx_slice_);
22616  __pyx_slice__2 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 102, __pyx_L1_error)
22617  __Pyx_GOTREF(__pyx_slice__2);
22618  __Pyx_GIVEREF(__pyx_slice__2);
22619 
22620  /* "(tree fragment)":2
22621  * def __reduce_cython__(self):
22622  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
22623  * def __setstate_cython__(self, __pyx_state):
22624  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
22625  */
22626  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
22627  __Pyx_GOTREF(__pyx_tuple__3);
22628  __Pyx_GIVEREF(__pyx_tuple__3);
22629 
22630  /* "(tree fragment)":4
22631  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
22632  * def __setstate_cython__(self, __pyx_state):
22633  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
22634  */
22635  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
22636  __Pyx_GOTREF(__pyx_tuple__4);
22637  __Pyx_GIVEREF(__pyx_tuple__4);
22638 
22639  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
22640  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
22641  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
22642  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
22643  *
22644  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
22645  */
22646  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(3, 229, __pyx_L1_error)
22647  __Pyx_GOTREF(__pyx_tuple__5);
22648  __Pyx_GIVEREF(__pyx_tuple__5);
22649 
22650  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
22651  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
22652  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
22653  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
22654  *
22655  * info.buf = PyArray_DATA(self)
22656  */
22657  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(3, 233, __pyx_L1_error)
22658  __Pyx_GOTREF(__pyx_tuple__6);
22659  __Pyx_GIVEREF(__pyx_tuple__6);
22660 
22661  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
22662  * if ((descr.byteorder == c'>' and little_endian) or
22663  * (descr.byteorder == c'<' and not little_endian)):
22664  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
22665  * if t == NPY_BYTE: f = "b"
22666  * elif t == NPY_UBYTE: f = "B"
22667  */
22668  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(3, 263, __pyx_L1_error)
22669  __Pyx_GOTREF(__pyx_tuple__7);
22670  __Pyx_GIVEREF(__pyx_tuple__7);
22671 
22672  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":810
22673  *
22674  * if (end - f) - <int>(new_offset - offset[0]) < 15:
22675  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
22676  *
22677  * if ((child.byteorder == c'>' and little_endian) or
22678  */
22679  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(3, 810, __pyx_L1_error)
22680  __Pyx_GOTREF(__pyx_tuple__8);
22681  __Pyx_GIVEREF(__pyx_tuple__8);
22682 
22683  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
22684  * if ((child.byteorder == c'>' and little_endian) or
22685  * (child.byteorder == c'<' and not little_endian)):
22686  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
22687  * # One could encode it in the format string and have Cython
22688  * # complain instead, BUT: < and > in format strings also imply
22689  */
22690  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 814, __pyx_L1_error)
22691  __Pyx_GOTREF(__pyx_tuple__9);
22692  __Pyx_GIVEREF(__pyx_tuple__9);
22693 
22694  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
22695  * t = child.type_num
22696  * if end - f < 5:
22697  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
22698  *
22699  * # Until ticket #99 is fixed, use integers to avoid warnings
22700  */
22701  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(3, 834, __pyx_L1_error)
22702  __Pyx_GOTREF(__pyx_tuple__10);
22703  __Pyx_GIVEREF(__pyx_tuple__10);
22704 
22705  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1000
22706  * _import_array()
22707  * except Exception:
22708  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
22709  *
22710  * cdef inline int import_umath() except -1:
22711  */
22712  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 1000, __pyx_L1_error)
22713  __Pyx_GOTREF(__pyx_tuple__11);
22714  __Pyx_GIVEREF(__pyx_tuple__11);
22715 
22716  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1006
22717  * _import_umath()
22718  * except Exception:
22719  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
22720  *
22721  * cdef inline int import_ufunc() except -1:
22722  */
22723  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(3, 1006, __pyx_L1_error)
22724  __Pyx_GOTREF(__pyx_tuple__12);
22725  __Pyx_GIVEREF(__pyx_tuple__12);
22726 
22727  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1012
22728  * _import_umath()
22729  * except Exception:
22730  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
22731  */
22732  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(3, 1012, __pyx_L1_error)
22733  __Pyx_GOTREF(__pyx_tuple__13);
22734  __Pyx_GIVEREF(__pyx_tuple__13);
22735 
22736  /* "View.MemoryView":132
22737  *
22738  * if not self.ndim:
22739  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
22740  *
22741  * if itemsize <= 0:
22742  */
22743  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 132, __pyx_L1_error)
22744  __Pyx_GOTREF(__pyx_tuple__14);
22745  __Pyx_GIVEREF(__pyx_tuple__14);
22746 
22747  /* "View.MemoryView":135
22748  *
22749  * if itemsize <= 0:
22750  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
22751  *
22752  * if not isinstance(format, bytes):
22753  */
22754  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 135, __pyx_L1_error)
22755  __Pyx_GOTREF(__pyx_tuple__15);
22756  __Pyx_GIVEREF(__pyx_tuple__15);
22757 
22758  /* "View.MemoryView":138
22759  *
22760  * if not isinstance(format, bytes):
22761  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
22762  * self._format = format # keep a reference to the byte string
22763  * self.format = self._format
22764  */
22765  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 138, __pyx_L1_error)
22766  __Pyx_GOTREF(__pyx_tuple__16);
22767  __Pyx_GIVEREF(__pyx_tuple__16);
22768 
22769  /* "View.MemoryView":147
22770  *
22771  * if not self._shape:
22772  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
22773  *
22774  *
22775  */
22776  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 147, __pyx_L1_error)
22777  __Pyx_GOTREF(__pyx_tuple__17);
22778  __Pyx_GIVEREF(__pyx_tuple__17);
22779 
22780  /* "View.MemoryView":175
22781  * self.data = <char *>malloc(self.len)
22782  * if not self.data:
22783  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
22784  *
22785  * if self.dtype_is_object:
22786  */
22787  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 175, __pyx_L1_error)
22788  __Pyx_GOTREF(__pyx_tuple__18);
22789  __Pyx_GIVEREF(__pyx_tuple__18);
22790 
22791  /* "View.MemoryView":191
22792  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
22793  * if not (flags & bufmode):
22794  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
22795  * info.buf = self.data
22796  * info.len = self.len
22797  */
22798  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 191, __pyx_L1_error)
22799  __Pyx_GOTREF(__pyx_tuple__19);
22800  __Pyx_GIVEREF(__pyx_tuple__19);
22801 
22802  /* "(tree fragment)":2
22803  * def __reduce_cython__(self):
22804  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22805  * def __setstate_cython__(self, __pyx_state):
22806  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22807  */
22808  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 2, __pyx_L1_error)
22809  __Pyx_GOTREF(__pyx_tuple__20);
22810  __Pyx_GIVEREF(__pyx_tuple__20);
22811 
22812  /* "(tree fragment)":4
22813  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22814  * def __setstate_cython__(self, __pyx_state):
22815  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22816  */
22817  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error)
22818  __Pyx_GOTREF(__pyx_tuple__21);
22819  __Pyx_GIVEREF(__pyx_tuple__21);
22820 
22821  /* "View.MemoryView":413
22822  * def __setitem__(memoryview self, object index, object value):
22823  * if self.view.readonly:
22824  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
22825  *
22826  * have_slices, index = _unellipsify(index, self.view.ndim)
22827  */
22828  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 413, __pyx_L1_error)
22829  __Pyx_GOTREF(__pyx_tuple__22);
22830  __Pyx_GIVEREF(__pyx_tuple__22);
22831 
22832  /* "View.MemoryView":490
22833  * result = struct.unpack(self.view.format, bytesitem)
22834  * except struct.error:
22835  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
22836  * else:
22837  * if len(self.view.format) == 1:
22838  */
22839  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 490, __pyx_L1_error)
22840  __Pyx_GOTREF(__pyx_tuple__23);
22841  __Pyx_GIVEREF(__pyx_tuple__23);
22842 
22843  /* "View.MemoryView":515
22844  * def __getbuffer__(self, Py_buffer *info, int flags):
22845  * if flags & PyBUF_WRITABLE and self.view.readonly:
22846  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
22847  *
22848  * if flags & PyBUF_STRIDES:
22849  */
22850  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 515, __pyx_L1_error)
22851  __Pyx_GOTREF(__pyx_tuple__24);
22852  __Pyx_GIVEREF(__pyx_tuple__24);
22853 
22854  /* "View.MemoryView":565
22855  * if self.view.strides == NULL:
22856  *
22857  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
22858  *
22859  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22860  */
22861  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 565, __pyx_L1_error)
22862  __Pyx_GOTREF(__pyx_tuple__25);
22863  __Pyx_GIVEREF(__pyx_tuple__25);
22864 
22865  /* "View.MemoryView":572
22866  * def suboffsets(self):
22867  * if self.view.suboffsets == NULL:
22868  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
22869  *
22870  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22871  */
22872  __pyx_tuple__26 = PyTuple_New(1); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 572, __pyx_L1_error)
22873  __Pyx_GOTREF(__pyx_tuple__26);
22874  __Pyx_INCREF(__pyx_int_neg_1);
22875  __Pyx_GIVEREF(__pyx_int_neg_1);
22876  PyTuple_SET_ITEM(__pyx_tuple__26, 0, __pyx_int_neg_1);
22877  __Pyx_GIVEREF(__pyx_tuple__26);
22878 
22879  /* "(tree fragment)":2
22880  * def __reduce_cython__(self):
22881  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22882  * def __setstate_cython__(self, __pyx_state):
22883  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22884  */
22885  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 2, __pyx_L1_error)
22886  __Pyx_GOTREF(__pyx_tuple__27);
22887  __Pyx_GIVEREF(__pyx_tuple__27);
22888 
22889  /* "(tree fragment)":4
22890  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22891  * def __setstate_cython__(self, __pyx_state):
22892  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22893  */
22894  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 4, __pyx_L1_error)
22895  __Pyx_GOTREF(__pyx_tuple__28);
22896  __Pyx_GIVEREF(__pyx_tuple__28);
22897 
22898  /* "View.MemoryView":677
22899  * if item is Ellipsis:
22900  * if not seen_ellipsis:
22901  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
22902  * seen_ellipsis = True
22903  * else:
22904  */
22905  __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) __PYX_ERR(1, 677, __pyx_L1_error)
22906  __Pyx_GOTREF(__pyx_slice__29);
22907  __Pyx_GIVEREF(__pyx_slice__29);
22908 
22909  /* "View.MemoryView":680
22910  * seen_ellipsis = True
22911  * else:
22912  * result.append(slice(None)) # <<<<<<<<<<<<<<
22913  * have_slices = True
22914  * else:
22915  */
22916  __pyx_slice__30 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__30)) __PYX_ERR(1, 680, __pyx_L1_error)
22917  __Pyx_GOTREF(__pyx_slice__30);
22918  __Pyx_GIVEREF(__pyx_slice__30);
22919 
22920  /* "View.MemoryView":691
22921  * nslices = ndim - len(result)
22922  * if nslices:
22923  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
22924  *
22925  * return have_slices or nslices, tuple(result)
22926  */
22927  __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(1, 691, __pyx_L1_error)
22928  __Pyx_GOTREF(__pyx_slice__31);
22929  __Pyx_GIVEREF(__pyx_slice__31);
22930 
22931  /* "View.MemoryView":698
22932  * for suboffset in suboffsets[:ndim]:
22933  * if suboffset >= 0:
22934  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
22935  *
22936  *
22937  */
22938  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 698, __pyx_L1_error)
22939  __Pyx_GOTREF(__pyx_tuple__32);
22940  __Pyx_GIVEREF(__pyx_tuple__32);
22941 
22942  /* "(tree fragment)":2
22943  * def __reduce_cython__(self):
22944  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22945  * def __setstate_cython__(self, __pyx_state):
22946  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22947  */
22948  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 2, __pyx_L1_error)
22949  __Pyx_GOTREF(__pyx_tuple__33);
22950  __Pyx_GIVEREF(__pyx_tuple__33);
22951 
22952  /* "(tree fragment)":4
22953  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22954  * def __setstate_cython__(self, __pyx_state):
22955  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22956  */
22957  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 4, __pyx_L1_error)
22958  __Pyx_GOTREF(__pyx_tuple__34);
22959  __Pyx_GIVEREF(__pyx_tuple__34);
22960 
22961  /* "BoundaryConditions.py":41
22962  * # setattr(BC_Base, name, default_value)
22963  *
22964  * def getContext(self, context=None): # <<<<<<<<<<<<<<
22965  * """
22966  * Gets context from proteus.Context or
22967  */
22968  __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_Context); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 41, __pyx_L1_error)
22969  __Pyx_GOTREF(__pyx_tuple__35);
22970  __Pyx_GIVEREF(__pyx_tuple__35);
22971  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_getContext, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 41, __pyx_L1_error)
22972 
22973  /* "(tree fragment)":1
22974  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22975  * cdef bint use_setstate
22976  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
22977  */
22978  __pyx_tuple__37 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_use_setstate, __pyx_n_s_state, __pyx_n_s_dict_2); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 1, __pyx_L1_error)
22979  __Pyx_GOTREF(__pyx_tuple__37);
22980  __Pyx_GIVEREF(__pyx_tuple__37);
22981  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(1, 1, __pyx_L1_error)
22982 
22983  /* "(tree fragment)":14
22984  * else:
22985  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
22986  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22987  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
22988  */
22989  __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 14, __pyx_L1_error)
22990  __Pyx_GOTREF(__pyx_tuple__39);
22991  __Pyx_GIVEREF(__pyx_tuple__39);
22992  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 14, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(1, 14, __pyx_L1_error)
22993 
22994  /* "BoundaryConditions.py":70
22995  * self.uOfXT = None
22996  *
22997  * def init_cython(self): # <<<<<<<<<<<<<<
22998  * return self.uOfXT
22999  *
23000  */
23001  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 70, __pyx_L1_error)
23002  __Pyx_GOTREF(__pyx_tuple__41);
23003  __Pyx_GIVEREF(__pyx_tuple__41);
23004  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_init_cython, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 70, __pyx_L1_error)
23005 
23006  /* "BoundaryConditions.py":73
23007  * return self.uOfXT
23008  *
23009  * def resetBC(self): # <<<<<<<<<<<<<<
23010  * self.uOfXT = None
23011  *
23012  */
23013  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 73, __pyx_L1_error)
23014  __Pyx_GOTREF(__pyx_tuple__43);
23015  __Pyx_GIVEREF(__pyx_tuple__43);
23016  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_resetBC, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 73, __pyx_L1_error)
23017 
23018  /* "BoundaryConditions.py":76
23019  * self.uOfXT = None
23020  *
23021  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
23022  * """
23023  * function returning constant BC
23024  */
23025  __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 76, __pyx_L1_error)
23026  __Pyx_GOTREF(__pyx_tuple__45);
23027  __Pyx_GIVEREF(__pyx_tuple__45);
23028  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setConstantBC, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 76, __pyx_L1_error)
23029 
23030  /* "BoundaryConditions.py":89
23031  *
23032  *
23033  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
23034  * """
23035  * function returning value=a0+ax*x+ay*y+az*z
23036  */
23037  __pyx_tuple__47 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_a0, __pyx_n_s_a); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 89, __pyx_L1_error)
23038  __Pyx_GOTREF(__pyx_tuple__47);
23039  __Pyx_GIVEREF(__pyx_tuple__47);
23040  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearBC, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 89, __pyx_L1_error)
23041 
23042  /* "BoundaryConditions.py":104
23043  * self.uOfXT = lambda x, t: a0+sum(a[:]*x[:])
23044  *
23045  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
23046  * """
23047  * function setting a linear ramp from t=0 to t=t1
23048  */
23049  __pyx_tuple__49 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_t1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 104, __pyx_L1_error)
23050  __Pyx_GOTREF(__pyx_tuple__49);
23051  __Pyx_GIVEREF(__pyx_tuple__49);
23052  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearRamp, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 104, __pyx_L1_error)
23053 
23054  /* "(tree fragment)":1
23055  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23056  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23057  * def __setstate_cython__(self, __pyx_state):
23058  */
23059  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 1, __pyx_L1_error)
23060  __Pyx_GOTREF(__pyx_tuple__51);
23061  __Pyx_GIVEREF(__pyx_tuple__51);
23062  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(1, 1, __pyx_L1_error)
23063 
23064  /* "(tree fragment)":3
23065  * def __reduce_cython__(self):
23066  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23067  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23068  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23069  */
23070  __pyx_tuple__53 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 3, __pyx_L1_error)
23071  __Pyx_GOTREF(__pyx_tuple__53);
23072  __Pyx_GIVEREF(__pyx_tuple__53);
23073  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(1, 3, __pyx_L1_error)
23074 
23075  /* "(tree fragment)":1
23076  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23077  * if __pyx_checksum != 0x96e6a1f:
23078  * from pickle import PickleError as __pyx_PickleError
23079  */
23080  __pyx_tuple__55 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 1, __pyx_L1_error)
23081  __Pyx_GOTREF(__pyx_tuple__55);
23082  __Pyx_GIVEREF(__pyx_tuple__55);
23083  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BC_Base, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(1, 1, __pyx_L1_error)
23084 
23085  /* "View.MemoryView":285
23086  * return self.name
23087  *
23088  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23089  * cdef strided = Enum("<strided and direct>") # default
23090  * cdef indirect = Enum("<strided and indirect>")
23091  */
23092  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 285, __pyx_L1_error)
23093  __Pyx_GOTREF(__pyx_tuple__57);
23094  __Pyx_GIVEREF(__pyx_tuple__57);
23095 
23096  /* "View.MemoryView":286
23097  *
23098  * cdef generic = Enum("<strided and direct or indirect>")
23099  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23100  * cdef indirect = Enum("<strided and indirect>")
23101  *
23102  */
23103  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 286, __pyx_L1_error)
23104  __Pyx_GOTREF(__pyx_tuple__58);
23105  __Pyx_GIVEREF(__pyx_tuple__58);
23106 
23107  /* "View.MemoryView":287
23108  * cdef generic = Enum("<strided and direct or indirect>")
23109  * cdef strided = Enum("<strided and direct>") # default
23110  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23111  *
23112  *
23113  */
23114  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 287, __pyx_L1_error)
23115  __Pyx_GOTREF(__pyx_tuple__59);
23116  __Pyx_GIVEREF(__pyx_tuple__59);
23117 
23118  /* "View.MemoryView":290
23119  *
23120  *
23121  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23122  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23123  *
23124  */
23125  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 290, __pyx_L1_error)
23126  __Pyx_GOTREF(__pyx_tuple__60);
23127  __Pyx_GIVEREF(__pyx_tuple__60);
23128 
23129  /* "View.MemoryView":291
23130  *
23131  * cdef contiguous = Enum("<contiguous and direct>")
23132  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23133  *
23134  *
23135  */
23136  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 291, __pyx_L1_error)
23137  __Pyx_GOTREF(__pyx_tuple__61);
23138  __Pyx_GIVEREF(__pyx_tuple__61);
23139 
23140  /* "(tree fragment)":1
23141  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23142  * if __pyx_checksum != 0xb068931:
23143  * from pickle import PickleError as __pyx_PickleError
23144  */
23145  __pyx_tuple__62 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 1, __pyx_L1_error)
23146  __Pyx_GOTREF(__pyx_tuple__62);
23147  __Pyx_GIVEREF(__pyx_tuple__62);
23148  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(1, 1, __pyx_L1_error)
23149  __Pyx_RefNannyFinishContext();
23150  return 0;
23151  __pyx_L1_error:;
23152  __Pyx_RefNannyFinishContext();
23153  return -1;
23154 }
23155 
23156 static int __Pyx_InitGlobals(void) {
23157  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23158  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23159  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23160  __pyx_int_158231071 = PyInt_FromLong(158231071L); if (unlikely(!__pyx_int_158231071)) __PYX_ERR(0, 1, __pyx_L1_error)
23161  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23162  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23163  return 0;
23164  __pyx_L1_error:;
23165  return -1;
23166 }
23167 
23168 static int __Pyx_modinit_global_init_code(void); /*proto*/
23169 static int __Pyx_modinit_variable_export_code(void); /*proto*/
23170 static int __Pyx_modinit_function_export_code(void); /*proto*/
23171 static int __Pyx_modinit_type_init_code(void); /*proto*/
23172 static int __Pyx_modinit_type_import_code(void); /*proto*/
23173 static int __Pyx_modinit_variable_import_code(void); /*proto*/
23174 static int __Pyx_modinit_function_import_code(void); /*proto*/
23175 
23176 static int __Pyx_modinit_global_init_code(void) {
23177  __Pyx_RefNannyDeclarations
23178  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
23179  /*--- Global init code ---*/
23180  generic = Py_None; Py_INCREF(Py_None);
23181  strided = Py_None; Py_INCREF(Py_None);
23182  indirect = Py_None; Py_INCREF(Py_None);
23183  contiguous = Py_None; Py_INCREF(Py_None);
23184  indirect_contiguous = Py_None; Py_INCREF(Py_None);
23185  __Pyx_RefNannyFinishContext();
23186  return 0;
23187 }
23188 
23189 static int __Pyx_modinit_variable_export_code(void) {
23190  __Pyx_RefNannyDeclarations
23191  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
23192  /*--- Variable export code ---*/
23193  __Pyx_RefNannyFinishContext();
23194  return 0;
23195 }
23196 
23197 static int __Pyx_modinit_function_export_code(void) {
23198  __Pyx_RefNannyDeclarations
23199  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
23200  /*--- Function export code ---*/
23201  __Pyx_RefNannyFinishContext();
23202  return 0;
23203 }
23204 
23205 static int __Pyx_modinit_type_init_code(void) {
23206  __Pyx_RefNannyDeclarations
23207  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
23208  /*--- Type init code ---*/
23209  if (PyType_Ready(&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
23210  __pyx_type_18BoundaryConditions_BC_Base.tp_print = 0;
23211  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BC_Base.tp_dictoffset && __pyx_type_18BoundaryConditions_BC_Base.tp_getattro == PyObject_GenericGetAttr)) {
23212  __pyx_type_18BoundaryConditions_BC_Base.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23213  }
23214  if (PyObject_SetAttrString(__pyx_m, "BC_Base", (PyObject *)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
23215  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
23216  __pyx_ptype_18BoundaryConditions_BC_Base = &__pyx_type_18BoundaryConditions_BC_Base;
23217  __pyx_vtabptr_18BoundaryConditions_BoundaryCondition = &__pyx_vtable_18BoundaryConditions_BoundaryCondition;
23218  __pyx_vtable_18BoundaryConditions_BoundaryCondition.resetBC = (void (*)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, int __pyx_skip_dispatch))__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC;
23219  if (PyType_Ready(&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
23220  __pyx_type_18BoundaryConditions_BoundaryCondition.tp_print = 0;
23221  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dictoffset && __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro == PyObject_GenericGetAttr)) {
23222  __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23223  }
23224  if (__Pyx_SetVtable(__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dict, __pyx_vtabptr_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
23225  if (PyObject_SetAttrString(__pyx_m, "BoundaryCondition", (PyObject *)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
23226  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
23227  __pyx_ptype_18BoundaryConditions_BoundaryCondition = &__pyx_type_18BoundaryConditions_BoundaryCondition;
23228  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
23229  __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_print = 0;
23230  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro == PyObject_GenericGetAttr)) {
23231  __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23232  }
23233  __pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC;
23234  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
23235  __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_print = 0;
23236  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro == PyObject_GenericGetAttr)) {
23237  __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23238  }
23239  __pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
23240  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
23241  __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_print = 0;
23242  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro == PyObject_GenericGetAttr)) {
23243  __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23244  }
23245  __pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = &__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
23246  __pyx_vtabptr_array = &__pyx_vtable_array;
23247  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
23248  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23249  __pyx_type___pyx_array.tp_print = 0;
23250  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23251  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23252  __pyx_array_type = &__pyx_type___pyx_array;
23253  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 278, __pyx_L1_error)
23254  __pyx_type___pyx_MemviewEnum.tp_print = 0;
23255  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23256  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23257  }
23258  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 278, __pyx_L1_error)
23259  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23260  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23261  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23262  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23263  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23264  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23265  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23266  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
23267  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23268  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23269  __pyx_type___pyx_memoryview.tp_print = 0;
23270  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23271  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23272  }
23273  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23274  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23275  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23276  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23277  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23278  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
23279  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23280  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23281  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23282  __pyx_type___pyx_memoryviewslice.tp_print = 0;
23283  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23284  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23285  }
23286  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23287  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23288  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23289  __Pyx_RefNannyFinishContext();
23290  return 0;
23291  __pyx_L1_error:;
23292  __Pyx_RefNannyFinishContext();
23293  return -1;
23294 }
23295 
23296 static int __Pyx_modinit_type_import_code(void) {
23297  __Pyx_RefNannyDeclarations
23298  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
23299  /*--- Type import code ---*/
23300  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
23301  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23302  sizeof(PyTypeObject),
23303  #else
23304  sizeof(PyHeapTypeObject),
23305  #endif
23306  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(4, 9, __pyx_L1_error)
23307  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(3, 164, __pyx_L1_error)
23308  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(3, 186, __pyx_L1_error)
23309  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(3, 190, __pyx_L1_error)
23310  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(3, 199, __pyx_L1_error)
23311  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(3, 872, __pyx_L1_error)
23312  __Pyx_RefNannyFinishContext();
23313  return 0;
23314  __pyx_L1_error:;
23315  __Pyx_RefNannyFinishContext();
23316  return -1;
23317 }
23318 
23319 static int __Pyx_modinit_variable_import_code(void) {
23320  __Pyx_RefNannyDeclarations
23321  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
23322  /*--- Variable import code ---*/
23323  __Pyx_RefNannyFinishContext();
23324  return 0;
23325 }
23326 
23327 static int __Pyx_modinit_function_import_code(void) {
23328  __Pyx_RefNannyDeclarations
23329  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
23330  /*--- Function import code ---*/
23331  __Pyx_RefNannyFinishContext();
23332  return 0;
23333 }
23334 
23335 
23336 #if PY_MAJOR_VERSION < 3
23337 #ifdef CYTHON_NO_PYINIT_EXPORT
23338 #define __Pyx_PyMODINIT_FUNC void
23339 #else
23340 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23341 #endif
23342 #else
23343 #ifdef CYTHON_NO_PYINIT_EXPORT
23344 #define __Pyx_PyMODINIT_FUNC PyObject *
23345 #else
23346 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23347 #endif
23348 #endif
23349 #ifndef CYTHON_SMALL_CODE
23350 #if defined(__clang__)
23351  #define CYTHON_SMALL_CODE
23352 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
23353  #define CYTHON_SMALL_CODE __attribute__((cold))
23354 #else
23355  #define CYTHON_SMALL_CODE
23356 #endif
23357 #endif
23358 
23359 
23360 #if PY_MAJOR_VERSION < 3
23361 __Pyx_PyMODINIT_FUNC initBoundaryConditions(void) CYTHON_SMALL_CODE; /*proto*/
23362 __Pyx_PyMODINIT_FUNC initBoundaryConditions(void)
23363 #else
23364 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void) CYTHON_SMALL_CODE; /*proto*/
23365 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)
23366 #if CYTHON_PEP489_MULTI_PHASE_INIT
23367 {
23368  return PyModuleDef_Init(&__pyx_moduledef);
23369 }
23370 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
23371  PyObject *value = PyObject_GetAttrString(spec, from_name);
23372  int result = 0;
23373  if (likely(value)) {
23374  result = PyDict_SetItemString(moddict, to_name, value);
23375  Py_DECREF(value);
23376  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23377  PyErr_Clear();
23378  } else {
23379  result = -1;
23380  }
23381  return result;
23382 }
23383 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23384  PyObject *module = NULL, *moddict, *modname;
23385  if (__pyx_m)
23386  return __Pyx_NewRef(__pyx_m);
23387  modname = PyObject_GetAttrString(spec, "name");
23388  if (unlikely(!modname)) goto bad;
23389  module = PyModule_NewObject(modname);
23390  Py_DECREF(modname);
23391  if (unlikely(!module)) goto bad;
23392  moddict = PyModule_GetDict(module);
23393  if (unlikely(!moddict)) goto bad;
23394  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
23395  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
23396  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
23397  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
23398  return module;
23399 bad:
23400  Py_XDECREF(module);
23401  return NULL;
23402 }
23403 
23404 
23405 static int __pyx_pymod_exec_BoundaryConditions(PyObject *__pyx_pyinit_module)
23406 #endif
23407 #endif
23408 {
23409  PyObject *__pyx_t_1 = NULL;
23410  static PyThread_type_lock __pyx_t_2[8];
23411  __Pyx_RefNannyDeclarations
23412  #if CYTHON_PEP489_MULTI_PHASE_INIT
23413  if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
23414  #elif PY_MAJOR_VERSION >= 3
23415  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
23416  #endif
23417  #if CYTHON_REFNANNY
23418 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
23419 if (!__Pyx_RefNanny) {
23420  PyErr_Clear();
23421  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
23422  if (!__Pyx_RefNanny)
23423  Py_FatalError("failed to import 'refnanny' module");
23424 }
23425 #endif
23426  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", 0);
23427  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23428  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23429  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23430  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23431  #ifdef __Pyx_CyFunction_USED
23432  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23433  #endif
23434  #ifdef __Pyx_FusedFunction_USED
23435  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23436  #endif
23437  #ifdef __Pyx_Coroutine_USED
23438  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23439  #endif
23440  #ifdef __Pyx_Generator_USED
23441  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23442  #endif
23443  #ifdef __Pyx_AsyncGen_USED
23444  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23445  #endif
23446  #ifdef __Pyx_StopAsyncIteration_USED
23447  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23448  #endif
23449  /*--- Library function declarations ---*/
23450  /*--- Threads initialization code ---*/
23451  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23452  #ifdef WITH_THREAD /* Python build with threading support? */
23453  PyEval_InitThreads();
23454  #endif
23455  #endif
23456  /*--- Module creation code ---*/
23457  #if CYTHON_PEP489_MULTI_PHASE_INIT
23458  __pyx_m = __pyx_pyinit_module;
23459  Py_INCREF(__pyx_m);
23460  #else
23461  #if PY_MAJOR_VERSION < 3
23462  __pyx_m = Py_InitModule4("BoundaryConditions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23463  #else
23464  __pyx_m = PyModule_Create(&__pyx_moduledef);
23465  #endif
23466  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23467  #endif
23468  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23469  Py_INCREF(__pyx_d);
23470  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23471  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23472  #if CYTHON_COMPILING_IN_PYPY
23473  Py_INCREF(__pyx_b);
23474  #endif
23475  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23476  /*--- Initialize various global constants etc. ---*/
23477  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23478  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23479  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23480  #endif
23481  if (__pyx_module_is_main_BoundaryConditions) {
23482  if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23483  }
23484  #if PY_MAJOR_VERSION >= 3
23485  {
23486  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23487  if (!PyDict_GetItemString(modules, "BoundaryConditions")) {
23488  if (unlikely(PyDict_SetItemString(modules, "BoundaryConditions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23489  }
23490  }
23491  #endif
23492  /*--- Builtin init code ---*/
23493  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23494  /*--- Constants init code ---*/
23495  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23496  /*--- Global type/function init code ---*/
23497  (void)__Pyx_modinit_global_init_code();
23498  (void)__Pyx_modinit_variable_export_code();
23499  (void)__Pyx_modinit_function_export_code();
23500  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
23501  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
23502  (void)__Pyx_modinit_variable_import_code();
23503  (void)__Pyx_modinit_function_import_code();
23504  /*--- Execution code ---*/
23505  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23506  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23507  #endif
23508 
23509  /* "BoundaryConditions.py":41
23510  * # setattr(BC_Base, name, default_value)
23511  *
23512  * def getContext(self, context=None): # <<<<<<<<<<<<<<
23513  * """
23514  * Gets context from proteus.Context or
23515  */
23516  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_3getContext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base_getContext, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
23517  __Pyx_GOTREF(__pyx_t_1);
23518  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_getContext, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
23519  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23520  PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23521 
23522  /* "(tree fragment)":1
23523  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23524  * cdef bint use_setstate
23525  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
23526  */
23527  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___reduce_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23528  __Pyx_GOTREF(__pyx_t_1);
23529  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23530  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23531 
23532  /* "(tree fragment)":14
23533  * else:
23534  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
23535  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23536  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
23537  */
23538  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___setstate_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
23539  __Pyx_GOTREF(__pyx_t_1);
23540  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 14, __pyx_L1_error)
23541  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23542 
23543  /* "BoundaryConditions.py":70
23544  * self.uOfXT = None
23545  *
23546  * def init_cython(self): # <<<<<<<<<<<<<<
23547  * return self.uOfXT
23548  *
23549  */
23550  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_init_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
23551  __Pyx_GOTREF(__pyx_t_1);
23552  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_init_cython, __pyx_t_1) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
23553  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23554  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23555 
23556  /* "BoundaryConditions.py":73
23557  * return self.uOfXT
23558  *
23559  * def resetBC(self): # <<<<<<<<<<<<<<
23560  * self.uOfXT = None
23561  *
23562  */
23563  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_resetBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
23564  __Pyx_GOTREF(__pyx_t_1);
23565  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_resetBC, __pyx_t_1) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
23566  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23567  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23568 
23569  /* "BoundaryConditions.py":76
23570  * self.uOfXT = None
23571  *
23572  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
23573  * """
23574  * function returning constant BC
23575  */
23576  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setConstantBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
23577  __Pyx_GOTREF(__pyx_t_1);
23578  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setConstantBC, __pyx_t_1) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
23579  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23580  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23581 
23582  /* "BoundaryConditions.py":89
23583  *
23584  *
23585  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
23586  * """
23587  * function returning value=a0+ax*x+ay*y+az*z
23588  */
23589  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
23590  __Pyx_GOTREF(__pyx_t_1);
23591  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearBC, __pyx_t_1) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
23592  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23593  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23594 
23595  /* "BoundaryConditions.py":104
23596  * self.uOfXT = lambda x, t: a0+sum(a[:]*x[:])
23597  *
23598  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
23599  * """
23600  * function setting a linear ramp from t=0 to t=t1
23601  */
23602  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearRamp, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
23603  __Pyx_GOTREF(__pyx_t_1);
23604  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearRamp, __pyx_t_1) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
23605  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23606  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23607 
23608  /* "(tree fragment)":1
23609  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23610  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23611  * def __setstate_cython__(self, __pyx_state):
23612  */
23613  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___reduce_cytho, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23614  __Pyx_GOTREF(__pyx_t_1);
23615  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23616  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23617 
23618  /* "(tree fragment)":3
23619  * def __reduce_cython__(self):
23620  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23621  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23622  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23623  */
23624  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___setstate_cyt, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
23625  __Pyx_GOTREF(__pyx_t_1);
23626  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
23627  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23628 
23629  /* "(tree fragment)":1
23630  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23631  * if __pyx_checksum != 0x96e6a1f:
23632  * from pickle import PickleError as __pyx_PickleError
23633  */
23634  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base, 0, __pyx_n_s_pyx_unpickle_BC_Base, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23635  __Pyx_GOTREF(__pyx_t_1);
23636  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BC_Base, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23637  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23638 
23639  /* "BoundaryConditions.py":1
23640  * import cython # <<<<<<<<<<<<<<
23641  * """
23642  * Module for creating boundary conditions. Imported in SpatialTools.py
23643  */
23644  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23645  __Pyx_GOTREF(__pyx_t_1);
23646  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23647  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23648 
23649  /* "View.MemoryView":208
23650  * info.obj = self
23651  *
23652  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23653  *
23654  * def __dealloc__(array self):
23655  */
23656  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 208, __pyx_L1_error)
23657  __Pyx_GOTREF(__pyx_t_1);
23658  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 208, __pyx_L1_error)
23659  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23660  PyType_Modified(__pyx_array_type);
23661 
23662  /* "View.MemoryView":285
23663  * return self.name
23664  *
23665  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23666  * cdef strided = Enum("<strided and direct>") # default
23667  * cdef indirect = Enum("<strided and indirect>")
23668  */
23669  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 285, __pyx_L1_error)
23670  __Pyx_GOTREF(__pyx_t_1);
23671  __Pyx_XGOTREF(generic);
23672  __Pyx_DECREF_SET(generic, __pyx_t_1);
23673  __Pyx_GIVEREF(__pyx_t_1);
23674  __pyx_t_1 = 0;
23675 
23676  /* "View.MemoryView":286
23677  *
23678  * cdef generic = Enum("<strided and direct or indirect>")
23679  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23680  * cdef indirect = Enum("<strided and indirect>")
23681  *
23682  */
23683  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
23684  __Pyx_GOTREF(__pyx_t_1);
23685  __Pyx_XGOTREF(strided);
23686  __Pyx_DECREF_SET(strided, __pyx_t_1);
23687  __Pyx_GIVEREF(__pyx_t_1);
23688  __pyx_t_1 = 0;
23689 
23690  /* "View.MemoryView":287
23691  * cdef generic = Enum("<strided and direct or indirect>")
23692  * cdef strided = Enum("<strided and direct>") # default
23693  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23694  *
23695  *
23696  */
23697  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
23698  __Pyx_GOTREF(__pyx_t_1);
23699  __Pyx_XGOTREF(indirect);
23700  __Pyx_DECREF_SET(indirect, __pyx_t_1);
23701  __Pyx_GIVEREF(__pyx_t_1);
23702  __pyx_t_1 = 0;
23703 
23704  /* "View.MemoryView":290
23705  *
23706  *
23707  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23708  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23709  *
23710  */
23711  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error)
23712  __Pyx_GOTREF(__pyx_t_1);
23713  __Pyx_XGOTREF(contiguous);
23714  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23715  __Pyx_GIVEREF(__pyx_t_1);
23716  __pyx_t_1 = 0;
23717 
23718  /* "View.MemoryView":291
23719  *
23720  * cdef contiguous = Enum("<contiguous and direct>")
23721  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23722  *
23723  *
23724  */
23725  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
23726  __Pyx_GOTREF(__pyx_t_1);
23727  __Pyx_XGOTREF(indirect_contiguous);
23728  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
23729  __Pyx_GIVEREF(__pyx_t_1);
23730  __pyx_t_1 = 0;
23731 
23732  /* "View.MemoryView":315
23733  *
23734  * DEF THREAD_LOCKS_PREALLOCATED = 8
23735  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
23736  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
23737  * PyThread_allocate_lock(),
23738  */
23739  __pyx_memoryview_thread_locks_used = 0;
23740 
23741  /* "View.MemoryView":316
23742  * DEF THREAD_LOCKS_PREALLOCATED = 8
23743  * cdef int __pyx_memoryview_thread_locks_used = 0
23744  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
23745  * PyThread_allocate_lock(),
23746  * PyThread_allocate_lock(),
23747  */
23748  __pyx_t_2[0] = PyThread_allocate_lock();
23749  __pyx_t_2[1] = PyThread_allocate_lock();
23750  __pyx_t_2[2] = PyThread_allocate_lock();
23751  __pyx_t_2[3] = PyThread_allocate_lock();
23752  __pyx_t_2[4] = PyThread_allocate_lock();
23753  __pyx_t_2[5] = PyThread_allocate_lock();
23754  __pyx_t_2[6] = PyThread_allocate_lock();
23755  __pyx_t_2[7] = PyThread_allocate_lock();
23756  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23757 
23758  /* "View.MemoryView":544
23759  * info.obj = self
23760  *
23761  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23762  *
23763  *
23764  */
23765  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 544, __pyx_L1_error)
23766  __Pyx_GOTREF(__pyx_t_1);
23767  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 544, __pyx_L1_error)
23768  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23769  PyType_Modified(__pyx_memoryview_type);
23770 
23771  /* "View.MemoryView":990
23772  * return self.from_object
23773  *
23774  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23775  *
23776  *
23777  */
23778  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 990, __pyx_L1_error)
23779  __Pyx_GOTREF(__pyx_t_1);
23780  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 990, __pyx_L1_error)
23781  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23782  PyType_Modified(__pyx_memoryviewslice_type);
23783 
23784  /* "(tree fragment)":1
23785  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23786  * if __pyx_checksum != 0xb068931:
23787  * from pickle import PickleError as __pyx_PickleError
23788  */
23789  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23790  __Pyx_GOTREF(__pyx_t_1);
23791  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23792  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23793 
23794  /* "(tree fragment)":9
23795  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23796  * return __pyx_result
23797  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
23798  * __pyx_result.name = __pyx_state[0]
23799  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
23800  */
23801 
23802  /*--- Wrapped vars code ---*/
23803 
23804  goto __pyx_L0;
23805  __pyx_L1_error:;
23806  __Pyx_XDECREF(__pyx_t_1);
23807  if (__pyx_m) {
23808  if (__pyx_d) {
23809  __Pyx_AddTraceback("init BoundaryConditions", 0, __pyx_lineno, __pyx_filename);
23810  }
23811  Py_DECREF(__pyx_m); __pyx_m = 0;
23812  } else if (!PyErr_Occurred()) {
23813  PyErr_SetString(PyExc_ImportError, "init BoundaryConditions");
23814  }
23815  __pyx_L0:;
23816  __Pyx_RefNannyFinishContext();
23817  #if CYTHON_PEP489_MULTI_PHASE_INIT
23818  return (__pyx_m != NULL) ? 0 : -1;
23819  #elif PY_MAJOR_VERSION >= 3
23820  return __pyx_m;
23821  #else
23822  return;
23823  #endif
23824 }
23825 
23826 /* --- Runtime support code --- */
23827 /* Refnanny */
23828 #if CYTHON_REFNANNY
23829 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
23830  PyObject *m = NULL, *p = NULL;
23831  void *r = NULL;
23832  m = PyImport_ImportModule((char *)modname);
23833  if (!m) goto end;
23834  p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
23835  if (!p) goto end;
23836  r = PyLong_AsVoidPtr(p);
23837 end:
23838  Py_XDECREF(p);
23839  Py_XDECREF(m);
23840  return (__Pyx_RefNannyAPIStruct *)r;
23841 }
23842 #endif
23843 
23844 /* PyObjectGetAttrStr */
23845 #if CYTHON_USE_TYPE_SLOTS
23846 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23847  PyTypeObject* tp = Py_TYPE(obj);
23848  if (likely(tp->tp_getattro))
23849  return tp->tp_getattro(obj, attr_name);
23850 #if PY_MAJOR_VERSION < 3
23851  if (likely(tp->tp_getattr))
23852  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23853 #endif
23854  return PyObject_GetAttr(obj, attr_name);
23855 }
23856 #endif
23857 
23858 /* GetBuiltinName */
23859 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23860  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23861  if (unlikely(!result)) {
23862  PyErr_Format(PyExc_NameError,
23863 #if PY_MAJOR_VERSION >= 3
23864  "name '%U' is not defined", name);
23865 #else
23866  "name '%.200s' is not defined", PyString_AS_STRING(name));
23867 #endif
23868  }
23869  return result;
23870 }
23871 
23872 /* RaiseDoubleKeywords */
23873 static void __Pyx_RaiseDoubleKeywordsError(
23874  const char* func_name,
23875  PyObject* kw_name)
23876 {
23877  PyErr_Format(PyExc_TypeError,
23878  #if PY_MAJOR_VERSION >= 3
23879  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23880  #else
23881  "%s() got multiple values for keyword argument '%s'", func_name,
23882  PyString_AsString(kw_name));
23883  #endif
23884 }
23885 
23886 /* ParseKeywords */
23887 static int __Pyx_ParseOptionalKeywords(
23888  PyObject *kwds,
23889  PyObject **argnames[],
23890  PyObject *kwds2,
23891  PyObject *values[],
23892  Py_ssize_t num_pos_args,
23893  const char* function_name)
23894 {
23895  PyObject *key = 0, *value = 0;
23896  Py_ssize_t pos = 0;
23897  PyObject*** name;
23898  PyObject*** first_kw_arg = argnames + num_pos_args;
23899  while (PyDict_Next(kwds, &pos, &key, &value)) {
23900  name = first_kw_arg;
23901  while (*name && (**name != key)) name++;
23902  if (*name) {
23903  values[name-argnames] = value;
23904  continue;
23905  }
23906  name = first_kw_arg;
23907  #if PY_MAJOR_VERSION < 3
23908  if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
23909  while (*name) {
23910  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23911  && _PyString_Eq(**name, key)) {
23912  values[name-argnames] = value;
23913  break;
23914  }
23915  name++;
23916  }
23917  if (*name) continue;
23918  else {
23919  PyObject*** argname = argnames;
23920  while (argname != first_kw_arg) {
23921  if ((**argname == key) || (
23922  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23923  && _PyString_Eq(**argname, key))) {
23924  goto arg_passed_twice;
23925  }
23926  argname++;
23927  }
23928  }
23929  } else
23930  #endif
23931  if (likely(PyUnicode_Check(key))) {
23932  while (*name) {
23933  int cmp = (**name == key) ? 0 :
23934  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23935  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
23936  #endif
23937  PyUnicode_Compare(**name, key);
23938  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23939  if (cmp == 0) {
23940  values[name-argnames] = value;
23941  break;
23942  }
23943  name++;
23944  }
23945  if (*name) continue;
23946  else {
23947  PyObject*** argname = argnames;
23948  while (argname != first_kw_arg) {
23949  int cmp = (**argname == key) ? 0 :
23950  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23951  (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
23952  #endif
23953  PyUnicode_Compare(**argname, key);
23954  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23955  if (cmp == 0) goto arg_passed_twice;
23956  argname++;
23957  }
23958  }
23959  } else
23960  goto invalid_keyword_type;
23961  if (kwds2) {
23962  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23963  } else {
23964  goto invalid_keyword;
23965  }
23966  }
23967  return 0;
23968 arg_passed_twice:
23969  __Pyx_RaiseDoubleKeywordsError(function_name, key);
23970  goto bad;
23971 invalid_keyword_type:
23972  PyErr_Format(PyExc_TypeError,
23973  "%.200s() keywords must be strings", function_name);
23974  goto bad;
23975 invalid_keyword:
23976  PyErr_Format(PyExc_TypeError,
23977  #if PY_MAJOR_VERSION < 3
23978  "%.200s() got an unexpected keyword argument '%.200s'",
23979  function_name, PyString_AsString(key));
23980  #else
23981  "%s() got an unexpected keyword argument '%U'",
23982  function_name, key);
23983  #endif
23984 bad:
23985  return -1;
23986 }
23987 
23988 /* RaiseArgTupleInvalid */
23989 static void __Pyx_RaiseArgtupleInvalid(
23990  const char* func_name,
23991  int exact,
23992  Py_ssize_t num_min,
23993  Py_ssize_t num_max,
23994  Py_ssize_t num_found)
23995 {
23996  Py_ssize_t num_expected;
23997  const char *more_or_less;
23998  if (num_found < num_min) {
23999  num_expected = num_min;
24000  more_or_less = "at least";
24001  } else {
24002  num_expected = num_max;
24003  more_or_less = "at most";
24004  }
24005  if (exact) {
24006  more_or_less = "exactly";
24007  }
24008  PyErr_Format(PyExc_TypeError,
24009  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
24010  func_name, more_or_less, num_expected,
24011  (num_expected == 1) ? "" : "s", num_found);
24012 }
24013 
24014 /* GetItemInt */
24015 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24016  PyObject *r;
24017  if (!j) return NULL;
24018  r = PyObject_GetItem(o, j);
24019  Py_DECREF(j);
24020  return r;
24021 }
24022 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24023  CYTHON_NCP_UNUSED int wraparound,
24024  CYTHON_NCP_UNUSED int boundscheck) {
24025 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24026  Py_ssize_t wrapped_i = i;
24027  if (wraparound & unlikely(i < 0)) {
24028  wrapped_i += PyList_GET_SIZE(o);
24029  }
24030  if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
24031  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24032  Py_INCREF(r);
24033  return r;
24034  }
24035  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24036 #else
24037  return PySequence_GetItem(o, i);
24038 #endif
24039 }
24040 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24041  CYTHON_NCP_UNUSED int wraparound,
24042  CYTHON_NCP_UNUSED int boundscheck) {
24043 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24044  Py_ssize_t wrapped_i = i;
24045  if (wraparound & unlikely(i < 0)) {
24046  wrapped_i += PyTuple_GET_SIZE(o);
24047  }
24048  if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
24049  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24050  Py_INCREF(r);
24051  return r;
24052  }
24053  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24054 #else
24055  return PySequence_GetItem(o, i);
24056 #endif
24057 }
24058 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
24059  CYTHON_NCP_UNUSED int wraparound,
24060  CYTHON_NCP_UNUSED int boundscheck) {
24061 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24062  if (is_list || PyList_CheckExact(o)) {
24063  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24064  if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
24065  PyObject *r = PyList_GET_ITEM(o, n);
24066  Py_INCREF(r);
24067  return r;
24068  }
24069  }
24070  else if (PyTuple_CheckExact(o)) {
24071  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24072  if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
24073  PyObject *r = PyTuple_GET_ITEM(o, n);
24074  Py_INCREF(r);
24075  return r;
24076  }
24077  } else {
24078  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24079  if (likely(m && m->sq_item)) {
24080  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24081  Py_ssize_t l = m->sq_length(o);
24082  if (likely(l >= 0)) {
24083  i += l;
24084  } else {
24085  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24086  return NULL;
24087  PyErr_Clear();
24088  }
24089  }
24090  return m->sq_item(o, i);
24091  }
24092  }
24093 #else
24094  if (is_list || PySequence_Check(o)) {
24095  return PySequence_GetItem(o, i);
24096  }
24097 #endif
24098  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24099 }
24100 
24101 /* ObjectGetItem */
24102 #if CYTHON_USE_TYPE_SLOTS
24103 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24104  PyObject *runerr;
24105  Py_ssize_t key_value;
24106  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24107  if (unlikely(!(m && m->sq_item))) {
24108  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24109  return NULL;
24110  }
24111  key_value = __Pyx_PyIndex_AsSsize_t(index);
24112  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24113  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24114  }
24115  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24116  PyErr_Clear();
24117  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24118  }
24119  return NULL;
24120 }
24121 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24122  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24123  if (likely(m && m->mp_subscript)) {
24124  return m->mp_subscript(obj, key);
24125  }
24126  return __Pyx_PyObject_GetIndex(obj, key);
24127 }
24128 #endif
24129 
24130 /* MemviewSliceInit */
24131 static int
24132 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
24133  int ndim,
24134  __Pyx_memviewslice *memviewslice,
24135  int memview_is_new_reference)
24136 {
24137  __Pyx_RefNannyDeclarations
24138  int i, retval=-1;
24139  Py_buffer *buf = &memview->view;
24140  __Pyx_RefNannySetupContext("init_memviewslice", 0);
24141  if (!buf) {
24142  PyErr_SetString(PyExc_ValueError,
24143  "buf is NULL.");
24144  goto fail;
24145  } else if (memviewslice->memview || memviewslice->data) {
24146  PyErr_SetString(PyExc_ValueError,
24147  "memviewslice is already initialized!");
24148  goto fail;
24149  }
24150  if (buf->strides) {
24151  for (i = 0; i < ndim; i++) {
24152  memviewslice->strides[i] = buf->strides[i];
24153  }
24154  } else {
24155  Py_ssize_t stride = buf->itemsize;
24156  for (i = ndim - 1; i >= 0; i--) {
24157  memviewslice->strides[i] = stride;
24158  stride *= buf->shape[i];
24159  }
24160  }
24161  for (i = 0; i < ndim; i++) {
24162  memviewslice->shape[i] = buf->shape[i];
24163  if (buf->suboffsets) {
24164  memviewslice->suboffsets[i] = buf->suboffsets[i];
24165  } else {
24166  memviewslice->suboffsets[i] = -1;
24167  }
24168  }
24169  memviewslice->memview = memview;
24170  memviewslice->data = (char *)buf->buf;
24171  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24172  Py_INCREF(memview);
24173  }
24174  retval = 0;
24175  goto no_fail;
24176 fail:
24177  memviewslice->memview = 0;
24178  memviewslice->data = 0;
24179  retval = -1;
24180 no_fail:
24181  __Pyx_RefNannyFinishContext();
24182  return retval;
24183 }
24184 #ifndef Py_NO_RETURN
24185 #define Py_NO_RETURN
24186 #endif
24187 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
24188  va_list vargs;
24189  char msg[200];
24190 #ifdef HAVE_STDARG_PROTOTYPES
24191  va_start(vargs, fmt);
24192 #else
24193  va_start(vargs);
24194 #endif
24195  vsnprintf(msg, 200, fmt, vargs);
24196  va_end(vargs);
24197  Py_FatalError(msg);
24198 }
24199 static CYTHON_INLINE int
24200 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24201  PyThread_type_lock lock)
24202 {
24203  int result;
24204  PyThread_acquire_lock(lock, 1);
24205  result = (*acquisition_count)++;
24206  PyThread_release_lock(lock);
24207  return result;
24208 }
24209 static CYTHON_INLINE int
24210 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24211  PyThread_type_lock lock)
24212 {
24213  int result;
24214  PyThread_acquire_lock(lock, 1);
24215  result = (*acquisition_count)--;
24216  PyThread_release_lock(lock);
24217  return result;
24218 }
24219 static CYTHON_INLINE void
24220 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
24221 {
24222  int first_time;
24223  struct __pyx_memoryview_obj *memview = memslice->memview;
24224  if (!memview || (PyObject *) memview == Py_None)
24225  return;
24226  if (__pyx_get_slice_count(memview) < 0)
24227  __pyx_fatalerror("Acquisition count is %d (line %d)",
24228  __pyx_get_slice_count(memview), lineno);
24229  first_time = __pyx_add_acquisition_count(memview) == 0;
24230  if (first_time) {
24231  if (have_gil) {
24232  Py_INCREF((PyObject *) memview);
24233  } else {
24234  PyGILState_STATE _gilstate = PyGILState_Ensure();
24235  Py_INCREF((PyObject *) memview);
24236  PyGILState_Release(_gilstate);
24237  }
24238  }
24239 }
24240 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24241  int have_gil, int lineno) {
24242  int last_time;
24243  struct __pyx_memoryview_obj *memview = memslice->memview;
24244  if (!memview ) {
24245  return;
24246  } else if ((PyObject *) memview == Py_None) {
24247  memslice->memview = NULL;
24248  return;
24249  }
24250  if (__pyx_get_slice_count(memview) <= 0)
24251  __pyx_fatalerror("Acquisition count is %d (line %d)",
24252  __pyx_get_slice_count(memview), lineno);
24253  last_time = __pyx_sub_acquisition_count(memview) == 1;
24254  memslice->data = NULL;
24255  if (last_time) {
24256  if (have_gil) {
24257  Py_CLEAR(memslice->memview);
24258  } else {
24259  PyGILState_STATE _gilstate = PyGILState_Ensure();
24260  Py_CLEAR(memslice->memview);
24261  PyGILState_Release(_gilstate);
24262  }
24263  } else {
24264  memslice->memview = NULL;
24265  }
24266 }
24267 
24268 /* Import */
24269 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
24270  PyObject *empty_list = 0;
24271  PyObject *module = 0;
24272  PyObject *global_dict = 0;
24273  PyObject *empty_dict = 0;
24274  PyObject *list;
24275  #if PY_MAJOR_VERSION < 3
24276  PyObject *py_import;
24277  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
24278  if (!py_import)
24279  goto bad;
24280  #endif
24281  if (from_list)
24282  list = from_list;
24283  else {
24284  empty_list = PyList_New(0);
24285  if (!empty_list)
24286  goto bad;
24287  list = empty_list;
24288  }
24289  global_dict = PyModule_GetDict(__pyx_m);
24290  if (!global_dict)
24291  goto bad;
24292  empty_dict = PyDict_New();
24293  if (!empty_dict)
24294  goto bad;
24295  {
24296  #if PY_MAJOR_VERSION >= 3
24297  if (level == -1) {
24298  if (strchr(__Pyx_MODULE_NAME, '.')) {
24299  module = PyImport_ImportModuleLevelObject(
24300  name, global_dict, empty_dict, list, 1);
24301  if (!module) {
24302  if (!PyErr_ExceptionMatches(PyExc_ImportError))
24303  goto bad;
24304  PyErr_Clear();
24305  }
24306  }
24307  level = 0;
24308  }
24309  #endif
24310  if (!module) {
24311  #if PY_MAJOR_VERSION < 3
24312  PyObject *py_level = PyInt_FromLong(level);
24313  if (!py_level)
24314  goto bad;
24315  module = PyObject_CallFunctionObjArgs(py_import,
24316  name, global_dict, empty_dict, list, py_level, NULL);
24317  Py_DECREF(py_level);
24318  #else
24319  module = PyImport_ImportModuleLevelObject(
24320  name, global_dict, empty_dict, list, level);
24321  #endif
24322  }
24323  }
24324 bad:
24325  #if PY_MAJOR_VERSION < 3
24326  Py_XDECREF(py_import);
24327  #endif
24328  Py_XDECREF(empty_list);
24329  Py_XDECREF(empty_dict);
24330  return module;
24331 }
24332 
24333 /* ImportFrom */
24334 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
24335  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
24336  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
24337  PyErr_Format(PyExc_ImportError,
24338  #if PY_MAJOR_VERSION < 3
24339  "cannot import name %.230s", PyString_AS_STRING(name));
24340  #else
24341  "cannot import name %S", name);
24342  #endif
24343  }
24344  return value;
24345 }
24346 
24347 /* PyCFunctionFastCall */
24348 #if CYTHON_FAST_PYCCALL
24349 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24350  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24351  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24352  PyObject *self = PyCFunction_GET_SELF(func);
24353  int flags = PyCFunction_GET_FLAGS(func);
24354  assert(PyCFunction_Check(func));
24355  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
24356  assert(nargs >= 0);
24357  assert(nargs == 0 || args != NULL);
24358  /* _PyCFunction_FastCallDict() must not be called with an exception set,
24359  because it may clear it (directly or indirectly) and so the
24360  caller loses its exception */
24361  assert(!PyErr_Occurred());
24362  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24363  return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
24364  } else {
24365  return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
24366  }
24367 }
24368 #endif
24369 
24370 /* PyFunctionFastCall */
24371 #if CYTHON_FAST_PYCALL
24372 #include "frameobject.h"
24373 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24374  PyObject *globals) {
24375  PyFrameObject *f;
24376  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24377  PyObject **fastlocals;
24378  Py_ssize_t i;
24379  PyObject *result;
24380  assert(globals != NULL);
24381  /* XXX Perhaps we should create a specialized
24382  PyFrame_New() that doesn't take locals, but does
24383  take builtins without sanity checking them.
24384  */
24385  assert(tstate != NULL);
24386  f = PyFrame_New(tstate, co, globals, NULL);
24387  if (f == NULL) {
24388  return NULL;
24389  }
24390  fastlocals = f->f_localsplus;
24391  for (i = 0; i < na; i++) {
24392  Py_INCREF(*args);
24393  fastlocals[i] = *args++;
24394  }
24395  result = PyEval_EvalFrameEx(f,0);
24396  ++tstate->recursion_depth;
24397  Py_DECREF(f);
24398  --tstate->recursion_depth;
24399  return result;
24400 }
24401 #if 1 || PY_VERSION_HEX < 0x030600B1
24402 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
24403  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24404  PyObject *globals = PyFunction_GET_GLOBALS(func);
24405  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24406  PyObject *closure;
24407 #if PY_MAJOR_VERSION >= 3
24408  PyObject *kwdefs;
24409 #endif
24410  PyObject *kwtuple, **k;
24411  PyObject **d;
24412  Py_ssize_t nd;
24413  Py_ssize_t nk;
24414  PyObject *result;
24415  assert(kwargs == NULL || PyDict_Check(kwargs));
24416  nk = kwargs ? PyDict_Size(kwargs) : 0;
24417  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
24418  return NULL;
24419  }
24420  if (
24421 #if PY_MAJOR_VERSION >= 3
24422  co->co_kwonlyargcount == 0 &&
24423 #endif
24424  likely(kwargs == NULL || nk == 0) &&
24425  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24426  if (argdefs == NULL && co->co_argcount == nargs) {
24427  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24428  goto done;
24429  }
24430  else if (nargs == 0 && argdefs != NULL
24431  && co->co_argcount == Py_SIZE(argdefs)) {
24432  /* function called with no arguments, but all parameters have
24433  a default value: use default values as arguments .*/
24434  args = &PyTuple_GET_ITEM(argdefs, 0);
24435  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24436  goto done;
24437  }
24438  }
24439  if (kwargs != NULL) {
24440  Py_ssize_t pos, i;
24441  kwtuple = PyTuple_New(2 * nk);
24442  if (kwtuple == NULL) {
24443  result = NULL;
24444  goto done;
24445  }
24446  k = &PyTuple_GET_ITEM(kwtuple, 0);
24447  pos = i = 0;
24448  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24449  Py_INCREF(k[i]);
24450  Py_INCREF(k[i+1]);
24451  i += 2;
24452  }
24453  nk = i / 2;
24454  }
24455  else {
24456  kwtuple = NULL;
24457  k = NULL;
24458  }
24459  closure = PyFunction_GET_CLOSURE(func);
24460 #if PY_MAJOR_VERSION >= 3
24461  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24462 #endif
24463  if (argdefs != NULL) {
24464  d = &PyTuple_GET_ITEM(argdefs, 0);
24465  nd = Py_SIZE(argdefs);
24466  }
24467  else {
24468  d = NULL;
24469  nd = 0;
24470  }
24471 #if PY_MAJOR_VERSION >= 3
24472  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24473  args, nargs,
24474  k, (int)nk,
24475  d, (int)nd, kwdefs, closure);
24476 #else
24477  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24478  args, nargs,
24479  k, (int)nk,
24480  d, (int)nd, closure);
24481 #endif
24482  Py_XDECREF(kwtuple);
24483 done:
24484  Py_LeaveRecursiveCall();
24485  return result;
24486 }
24487 #endif
24488 #endif
24489 
24490 /* PyObjectCall */
24491 #if CYTHON_COMPILING_IN_CPYTHON
24492 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24493  PyObject *result;
24494  ternaryfunc call = func->ob_type->tp_call;
24495  if (unlikely(!call))
24496  return PyObject_Call(func, arg, kw);
24497  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24498  return NULL;
24499  result = (*call)(func, arg, kw);
24500  Py_LeaveRecursiveCall();
24501  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24502  PyErr_SetString(
24503  PyExc_SystemError,
24504  "NULL result without error in PyObject_Call");
24505  }
24506  return result;
24507 }
24508 #endif
24509 
24510 /* PyObjectCallMethO */
24511 #if CYTHON_COMPILING_IN_CPYTHON
24512 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24513  PyObject *self, *result;
24514  PyCFunction cfunc;
24515  cfunc = PyCFunction_GET_FUNCTION(func);
24516  self = PyCFunction_GET_SELF(func);
24517  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24518  return NULL;
24519  result = cfunc(self, arg);
24520  Py_LeaveRecursiveCall();
24521  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24522  PyErr_SetString(
24523  PyExc_SystemError,
24524  "NULL result without error in PyObject_Call");
24525  }
24526  return result;
24527 }
24528 #endif
24529 
24530 /* PyObjectCallOneArg */
24531 #if CYTHON_COMPILING_IN_CPYTHON
24532 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24533  PyObject *result;
24534  PyObject *args = PyTuple_New(1);
24535  if (unlikely(!args)) return NULL;
24536  Py_INCREF(arg);
24537  PyTuple_SET_ITEM(args, 0, arg);
24538  result = __Pyx_PyObject_Call(func, args, NULL);
24539  Py_DECREF(args);
24540  return result;
24541 }
24542 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24543 #if CYTHON_FAST_PYCALL
24544  if (PyFunction_Check(func)) {
24545  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24546  }
24547 #endif
24548  if (likely(PyCFunction_Check(func))) {
24549  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24550  return __Pyx_PyObject_CallMethO(func, arg);
24551 #if CYTHON_FAST_PYCCALL
24552  } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24553  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24554 #endif
24555  }
24556  }
24557  return __Pyx__PyObject_CallOneArg(func, arg);
24558 }
24559 #else
24560 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24561  PyObject *result;
24562  PyObject *args = PyTuple_Pack(1, arg);
24563  if (unlikely(!args)) return NULL;
24564  result = __Pyx_PyObject_Call(func, args, NULL);
24565  Py_DECREF(args);
24566  return result;
24567 }
24568 #endif
24569 
24570 /* PyObjectCallNoArg */
24571 #if CYTHON_COMPILING_IN_CPYTHON
24572 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24573 #if CYTHON_FAST_PYCALL
24574  if (PyFunction_Check(func)) {
24575  return __Pyx_PyFunction_FastCall(func, NULL, 0);
24576  }
24577 #endif
24578 #ifdef __Pyx_CyFunction_USED
24579  if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
24580 #else
24581  if (likely(PyCFunction_Check(func))) {
24582 #endif
24583  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24584  return __Pyx_PyObject_CallMethO(func, NULL);
24585  }
24586  }
24587  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24588 }
24589 #endif
24590 
24591 /* PyErrExceptionMatches */
24592  #if CYTHON_FAST_THREAD_STATE
24593 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24594  Py_ssize_t i, n;
24595  n = PyTuple_GET_SIZE(tuple);
24596 #if PY_MAJOR_VERSION >= 3
24597  for (i=0; i<n; i++) {
24598  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24599  }
24600 #endif
24601  for (i=0; i<n; i++) {
24602  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
24603  }
24604  return 0;
24605 }
24606 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24607  PyObject *exc_type = tstate->curexc_type;
24608  if (exc_type == err) return 1;
24609  if (unlikely(!exc_type)) return 0;
24610  if (unlikely(PyTuple_Check(err)))
24611  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24612  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24613 }
24614 #endif
24615 
24616 /* PyErrFetchRestore */
24617  #if CYTHON_FAST_THREAD_STATE
24618 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24619  PyObject *tmp_type, *tmp_value, *tmp_tb;
24620  tmp_type = tstate->curexc_type;
24621  tmp_value = tstate->curexc_value;
24622  tmp_tb = tstate->curexc_traceback;
24623  tstate->curexc_type = type;
24624  tstate->curexc_value = value;
24625  tstate->curexc_traceback = tb;
24626  Py_XDECREF(tmp_type);
24627  Py_XDECREF(tmp_value);
24628  Py_XDECREF(tmp_tb);
24629 }
24630 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24631  *type = tstate->curexc_type;
24632  *value = tstate->curexc_value;
24633  *tb = tstate->curexc_traceback;
24634  tstate->curexc_type = 0;
24635  tstate->curexc_value = 0;
24636  tstate->curexc_traceback = 0;
24637 }
24638 #endif
24639 
24640 /* GetAttr */
24641  static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
24642 #if CYTHON_USE_TYPE_SLOTS
24643 #if PY_MAJOR_VERSION >= 3
24644  if (likely(PyUnicode_Check(n)))
24645 #else
24646  if (likely(PyString_Check(n)))
24647 #endif
24648  return __Pyx_PyObject_GetAttrStr(o, n);
24649 #endif
24650  return PyObject_GetAttr(o, n);
24651 }
24652 
24653 /* GetAttr3 */
24654  static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24655  __Pyx_PyThreadState_declare
24656  __Pyx_PyThreadState_assign
24657  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24658  return NULL;
24659  __Pyx_PyErr_Clear();
24660  Py_INCREF(d);
24661  return d;
24662 }
24663 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
24664  PyObject *r = __Pyx_GetAttr(o, n);
24665  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
24666 }
24667 
24668 /* GetModuleGlobalName */
24669  static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
24670  PyObject *result;
24671 #if !CYTHON_AVOID_BORROWED_REFS
24672 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24673  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24674  if (likely(result)) {
24675  Py_INCREF(result);
24676  } else if (unlikely(PyErr_Occurred())) {
24677  result = NULL;
24678  } else {
24679 #else
24680  result = PyDict_GetItem(__pyx_d, name);
24681  if (likely(result)) {
24682  Py_INCREF(result);
24683  } else {
24684 #endif
24685 #else
24686  result = PyObject_GetItem(__pyx_d, name);
24687  if (!result) {
24688  PyErr_Clear();
24689 #endif
24690  result = __Pyx_GetBuiltinName(name);
24691  }
24692  return result;
24693 }
24694 
24695 /* KeywordStringCheck */
24696  static int __Pyx_CheckKeywordStrings(
24697  PyObject *kwdict,
24698  const char* function_name,
24699  int kw_allowed)
24700 {
24701  PyObject* key = 0;
24702  Py_ssize_t pos = 0;
24703 #if CYTHON_COMPILING_IN_PYPY
24704  if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
24705  goto invalid_keyword;
24706  return 1;
24707 #else
24708  while (PyDict_Next(kwdict, &pos, &key, 0)) {
24709  #if PY_MAJOR_VERSION < 3
24710  if (unlikely(!PyString_Check(key)))
24711  #endif
24712  if (unlikely(!PyUnicode_Check(key)))
24713  goto invalid_keyword_type;
24714  }
24715  if ((!kw_allowed) && unlikely(key))
24716  goto invalid_keyword;
24717  return 1;
24718 invalid_keyword_type:
24719  PyErr_Format(PyExc_TypeError,
24720  "%.200s() keywords must be strings", function_name);
24721  return 0;
24722 #endif
24723 invalid_keyword:
24724  PyErr_Format(PyExc_TypeError,
24725  #if PY_MAJOR_VERSION < 3
24726  "%.200s() got an unexpected keyword argument '%.200s'",
24727  function_name, PyString_AsString(key));
24728  #else
24729  "%s() got an unexpected keyword argument '%U'",
24730  function_name, key);
24731  #endif
24732  return 0;
24733 }
24734 
24735 /* WriteUnraisableException */
24736  static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
24737  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
24738  int full_traceback, CYTHON_UNUSED int nogil) {
24739  PyObject *old_exc, *old_val, *old_tb;
24740  PyObject *ctx;
24741  __Pyx_PyThreadState_declare
24742 #ifdef WITH_THREAD
24743  PyGILState_STATE state;
24744  if (nogil)
24745  state = PyGILState_Ensure();
24746 #ifdef _MSC_VER
24747  else state = (PyGILState_STATE)-1;
24748 #endif
24749 #endif
24750  __Pyx_PyThreadState_assign
24751  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24752  if (full_traceback) {
24753  Py_XINCREF(old_exc);
24754  Py_XINCREF(old_val);
24755  Py_XINCREF(old_tb);
24756  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24757  PyErr_PrintEx(1);
24758  }
24759  #if PY_MAJOR_VERSION < 3
24760  ctx = PyString_FromString(name);
24761  #else
24762  ctx = PyUnicode_FromString(name);
24763  #endif
24764  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24765  if (!ctx) {
24766  PyErr_WriteUnraisable(Py_None);
24767  } else {
24768  PyErr_WriteUnraisable(ctx);
24769  Py_DECREF(ctx);
24770  }
24771 #ifdef WITH_THREAD
24772  if (nogil)
24773  PyGILState_Release(state);
24774 #endif
24775 }
24776 
24777 /* None */
24778  static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
24779  PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
24780 }
24781 
24782 /* FetchCommonType */
24783  static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
24784  PyObject* fake_module;
24785  PyTypeObject* cached_type = NULL;
24786  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
24787  if (!fake_module) return NULL;
24788  Py_INCREF(fake_module);
24789  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
24790  if (cached_type) {
24791  if (!PyType_Check((PyObject*)cached_type)) {
24792  PyErr_Format(PyExc_TypeError,
24793  "Shared Cython type %.200s is not a type object",
24794  type->tp_name);
24795  goto bad;
24796  }
24797  if (cached_type->tp_basicsize != type->tp_basicsize) {
24798  PyErr_Format(PyExc_TypeError,
24799  "Shared Cython type %.200s has the wrong size, try recompiling",
24800  type->tp_name);
24801  goto bad;
24802  }
24803  } else {
24804  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
24805  PyErr_Clear();
24806  if (PyType_Ready(type) < 0) goto bad;
24807  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
24808  goto bad;
24809  Py_INCREF(type);
24810  cached_type = type;
24811  }
24812 done:
24813  Py_DECREF(fake_module);
24814  return cached_type;
24815 bad:
24816  Py_XDECREF(cached_type);
24817  cached_type = NULL;
24818  goto done;
24819 }
24820 
24821 /* CythonFunction */
24822  #include <structmember.h>
24823 static PyObject *
24824 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
24825 {
24826  if (unlikely(op->func_doc == NULL)) {
24827  if (op->func.m_ml->ml_doc) {
24828 #if PY_MAJOR_VERSION >= 3
24829  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
24830 #else
24831  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
24832 #endif
24833  if (unlikely(op->func_doc == NULL))
24834  return NULL;
24835  } else {
24836  Py_INCREF(Py_None);
24837  return Py_None;
24838  }
24839  }
24840  Py_INCREF(op->func_doc);
24841  return op->func_doc;
24842 }
24843 static int
24844 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
24845 {
24846  PyObject *tmp = op->func_doc;
24847  if (value == NULL) {
24848  value = Py_None;
24849  }
24850  Py_INCREF(value);
24851  op->func_doc = value;
24852  Py_XDECREF(tmp);
24853  return 0;
24854 }
24855 static PyObject *
24856 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
24857 {
24858  if (unlikely(op->func_name == NULL)) {
24859 #if PY_MAJOR_VERSION >= 3
24860  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
24861 #else
24862  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
24863 #endif
24864  if (unlikely(op->func_name == NULL))
24865  return NULL;
24866  }
24867  Py_INCREF(op->func_name);
24868  return op->func_name;
24869 }
24870 static int
24871 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
24872 {
24873  PyObject *tmp;
24874 #if PY_MAJOR_VERSION >= 3
24875  if (unlikely(value == NULL || !PyUnicode_Check(value))) {
24876 #else
24877  if (unlikely(value == NULL || !PyString_Check(value))) {
24878 #endif
24879  PyErr_SetString(PyExc_TypeError,
24880  "__name__ must be set to a string object");
24881  return -1;
24882  }
24883  tmp = op->func_name;
24884  Py_INCREF(value);
24885  op->func_name = value;
24886  Py_XDECREF(tmp);
24887  return 0;
24888 }
24889 static PyObject *
24890 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
24891 {
24892  Py_INCREF(op->func_qualname);
24893  return op->func_qualname;
24894 }
24895 static int
24896 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
24897 {
24898  PyObject *tmp;
24899 #if PY_MAJOR_VERSION >= 3
24900  if (unlikely(value == NULL || !PyUnicode_Check(value))) {
24901 #else
24902  if (unlikely(value == NULL || !PyString_Check(value))) {
24903 #endif
24904  PyErr_SetString(PyExc_TypeError,
24905  "__qualname__ must be set to a string object");
24906  return -1;
24907  }
24908  tmp = op->func_qualname;
24909  Py_INCREF(value);
24910  op->func_qualname = value;
24911  Py_XDECREF(tmp);
24912  return 0;
24913 }
24914 static PyObject *
24915 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
24916 {
24917  PyObject *self;
24918  self = m->func_closure;
24919  if (self == NULL)
24920  self = Py_None;
24921  Py_INCREF(self);
24922  return self;
24923 }
24924 static PyObject *
24925 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
24926 {
24927  if (unlikely(op->func_dict == NULL)) {
24928  op->func_dict = PyDict_New();
24929  if (unlikely(op->func_dict == NULL))
24930  return NULL;
24931  }
24932  Py_INCREF(op->func_dict);
24933  return op->func_dict;
24934 }
24935 static int
24936 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
24937 {
24938  PyObject *tmp;
24939  if (unlikely(value == NULL)) {
24940  PyErr_SetString(PyExc_TypeError,
24941  "function's dictionary may not be deleted");
24942  return -1;
24943  }
24944  if (unlikely(!PyDict_Check(value))) {
24945  PyErr_SetString(PyExc_TypeError,
24946  "setting function's dictionary to a non-dict");
24947  return -1;
24948  }
24949  tmp = op->func_dict;
24950  Py_INCREF(value);
24951  op->func_dict = value;
24952  Py_XDECREF(tmp);
24953  return 0;
24954 }
24955 static PyObject *
24956 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
24957 {
24958  Py_INCREF(op->func_globals);
24959  return op->func_globals;
24960 }
24961 static PyObject *
24962 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
24963 {
24964  Py_INCREF(Py_None);
24965  return Py_None;
24966 }
24967 static PyObject *
24968 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
24969 {
24970  PyObject* result = (op->func_code) ? op->func_code : Py_None;
24971  Py_INCREF(result);
24972  return result;
24973 }
24974 static int
24975 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
24976  int result = 0;
24977  PyObject *res = op->defaults_getter((PyObject *) op);
24978  if (unlikely(!res))
24979  return -1;
24980  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24981  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
24982  Py_INCREF(op->defaults_tuple);
24983  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
24984  Py_INCREF(op->defaults_kwdict);
24985  #else
24986  op->defaults_tuple = PySequence_ITEM(res, 0);
24987  if (unlikely(!op->defaults_tuple)) result = -1;
24988  else {
24989  op->defaults_kwdict = PySequence_ITEM(res, 1);
24990  if (unlikely(!op->defaults_kwdict)) result = -1;
24991  }
24992  #endif
24993  Py_DECREF(res);
24994  return result;
24995 }
24996 static int
24997 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
24998  PyObject* tmp;
24999  if (!value) {
25000  value = Py_None;
25001  } else if (value != Py_None && !PyTuple_Check(value)) {
25002  PyErr_SetString(PyExc_TypeError,
25003  "__defaults__ must be set to a tuple object");
25004  return -1;
25005  }
25006  Py_INCREF(value);
25007  tmp = op->defaults_tuple;
25008  op->defaults_tuple = value;
25009  Py_XDECREF(tmp);
25010  return 0;
25011 }
25012 static PyObject *
25013 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
25014  PyObject* result = op->defaults_tuple;
25015  if (unlikely(!result)) {
25016  if (op->defaults_getter) {
25017  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25018  result = op->defaults_tuple;
25019  } else {
25020  result = Py_None;
25021  }
25022  }
25023  Py_INCREF(result);
25024  return result;
25025 }
25026 static int
25027 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
25028  PyObject* tmp;
25029  if (!value) {
25030  value = Py_None;
25031  } else if (value != Py_None && !PyDict_Check(value)) {
25032  PyErr_SetString(PyExc_TypeError,
25033  "__kwdefaults__ must be set to a dict object");
25034  return -1;
25035  }
25036  Py_INCREF(value);
25037  tmp = op->defaults_kwdict;
25038  op->defaults_kwdict = value;
25039  Py_XDECREF(tmp);
25040  return 0;
25041 }
25042 static PyObject *
25043 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
25044  PyObject* result = op->defaults_kwdict;
25045  if (unlikely(!result)) {
25046  if (op->defaults_getter) {
25047  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25048  result = op->defaults_kwdict;
25049  } else {
25050  result = Py_None;
25051  }
25052  }
25053  Py_INCREF(result);
25054  return result;
25055 }
25056 static int
25057 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
25058  PyObject* tmp;
25059  if (!value || value == Py_None) {
25060  value = NULL;
25061  } else if (!PyDict_Check(value)) {
25062  PyErr_SetString(PyExc_TypeError,
25063  "__annotations__ must be set to a dict object");
25064  return -1;
25065  }
25066  Py_XINCREF(value);
25067  tmp = op->func_annotations;
25068  op->func_annotations = value;
25069  Py_XDECREF(tmp);
25070  return 0;
25071 }
25072 static PyObject *
25073 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
25074  PyObject* result = op->func_annotations;
25075  if (unlikely(!result)) {
25076  result = PyDict_New();
25077  if (unlikely(!result)) return NULL;
25078  op->func_annotations = result;
25079  }
25080  Py_INCREF(result);
25081  return result;
25082 }
25083 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25084  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25085  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25086  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25087  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25088  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25089  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25090  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25091  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25092  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25093  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25094  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25095  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25096  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25097  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25098  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25099  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25100  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25101  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25102  {0, 0, 0, 0, 0}
25103 };
25104 static PyMemberDef __pyx_CyFunction_members[] = {
25105  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25106  {0, 0, 0, 0, 0}
25107 };
25108 static PyObject *
25109 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25110 {
25111 #if PY_MAJOR_VERSION >= 3
25112  return PyUnicode_FromString(m->func.m_ml->ml_name);
25113 #else
25114  return PyString_FromString(m->func.m_ml->ml_name);
25115 #endif
25116 }
25117 static PyMethodDef __pyx_CyFunction_methods[] = {
25118  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25119  {0, 0, 0, 0}
25120 };
25121 #if PY_VERSION_HEX < 0x030500A0
25122 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25123 #else
25124 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25125 #endif
25126 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
25127  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25128  __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
25129  if (op == NULL)
25130  return NULL;
25131  op->flags = flags;
25132  __Pyx_CyFunction_weakreflist(op) = NULL;
25133  op->func.m_ml = ml;
25134  op->func.m_self = (PyObject *) op;
25135  Py_XINCREF(closure);
25136  op->func_closure = closure;
25137  Py_XINCREF(module);
25138  op->func.m_module = module;
25139  op->func_dict = NULL;
25140  op->func_name = NULL;
25141  Py_INCREF(qualname);
25142  op->func_qualname = qualname;
25143  op->func_doc = NULL;
25144  op->func_classobj = NULL;
25145  op->func_globals = globals;
25146  Py_INCREF(op->func_globals);
25147  Py_XINCREF(code);
25148  op->func_code = code;
25149  op->defaults_pyobjects = 0;
25150  op->defaults = NULL;
25151  op->defaults_tuple = NULL;
25152  op->defaults_kwdict = NULL;
25153  op->defaults_getter = NULL;
25154  op->func_annotations = NULL;
25155  PyObject_GC_Track(op);
25156  return (PyObject *) op;
25157 }
25158 static int
25159 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25160 {
25161  Py_CLEAR(m->func_closure);
25162  Py_CLEAR(m->func.m_module);
25163  Py_CLEAR(m->func_dict);
25164  Py_CLEAR(m->func_name);
25165  Py_CLEAR(m->func_qualname);
25166  Py_CLEAR(m->func_doc);
25167  Py_CLEAR(m->func_globals);
25168  Py_CLEAR(m->func_code);
25169  Py_CLEAR(m->func_classobj);
25170  Py_CLEAR(m->defaults_tuple);
25171  Py_CLEAR(m->defaults_kwdict);
25172  Py_CLEAR(m->func_annotations);
25173  if (m->defaults) {
25174  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25175  int i;
25176  for (i = 0; i < m->defaults_pyobjects; i++)
25177  Py_XDECREF(pydefaults[i]);
25178  PyObject_Free(m->defaults);
25179  m->defaults = NULL;
25180  }
25181  return 0;
25182 }
25183 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25184 {
25185  if (__Pyx_CyFunction_weakreflist(m) != NULL)
25186  PyObject_ClearWeakRefs((PyObject *) m);
25187  __Pyx_CyFunction_clear(m);
25188  PyObject_GC_Del(m);
25189 }
25190 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25191 {
25192  PyObject_GC_UnTrack(m);
25193  __Pyx__CyFunction_dealloc(m);
25194 }
25195 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
25196 {
25197  Py_VISIT(m->func_closure);
25198  Py_VISIT(m->func.m_module);
25199  Py_VISIT(m->func_dict);
25200  Py_VISIT(m->func_name);
25201  Py_VISIT(m->func_qualname);
25202  Py_VISIT(m->func_doc);
25203  Py_VISIT(m->func_globals);
25204  Py_VISIT(m->func_code);
25205  Py_VISIT(m->func_classobj);
25206  Py_VISIT(m->defaults_tuple);
25207  Py_VISIT(m->defaults_kwdict);
25208  if (m->defaults) {
25209  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25210  int i;
25211  for (i = 0; i < m->defaults_pyobjects; i++)
25212  Py_VISIT(pydefaults[i]);
25213  }
25214  return 0;
25215 }
25216 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
25217 {
25218  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25219  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
25220  Py_INCREF(func);
25221  return func;
25222  }
25223  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
25224  if (type == NULL)
25225  type = (PyObject *)(Py_TYPE(obj));
25226  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
25227  }
25228  if (obj == Py_None)
25229  obj = NULL;
25230  return __Pyx_PyMethod_New(func, obj, type);
25231 }
25232 static PyObject*
25233 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
25234 {
25235 #if PY_MAJOR_VERSION >= 3
25236  return PyUnicode_FromFormat("<cyfunction %U at %p>",
25237  op->func_qualname, (void *)op);
25238 #else
25239  return PyString_FromFormat("<cyfunction %s at %p>",
25240  PyString_AsString(op->func_qualname), (void *)op);
25241 #endif
25242 }
25243 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
25244  PyCFunctionObject* f = (PyCFunctionObject*)func;
25245  PyCFunction meth = f->m_ml->ml_meth;
25246  Py_ssize_t size;
25247  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
25248  case METH_VARARGS:
25249  if (likely(kw == NULL || PyDict_Size(kw) == 0))
25250  return (*meth)(self, arg);
25251  break;
25252  case METH_VARARGS | METH_KEYWORDS:
25253  return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
25254  case METH_NOARGS:
25255  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25256  size = PyTuple_GET_SIZE(arg);
25257  if (likely(size == 0))
25258  return (*meth)(self, NULL);
25259  PyErr_Format(PyExc_TypeError,
25260  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
25261  f->m_ml->ml_name, size);
25262  return NULL;
25263  }
25264  break;
25265  case METH_O:
25266  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25267  size = PyTuple_GET_SIZE(arg);
25268  if (likely(size == 1)) {
25269  PyObject *result, *arg0;
25270  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25271  arg0 = PyTuple_GET_ITEM(arg, 0);
25272  #else
25273  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
25274  #endif
25275  result = (*meth)(self, arg0);
25276  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
25277  Py_DECREF(arg0);
25278  #endif
25279  return result;
25280  }
25281  PyErr_Format(PyExc_TypeError,
25282  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
25283  f->m_ml->ml_name, size);
25284  return NULL;
25285  }
25286  break;
25287  default:
25288  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
25289  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
25290  "longer supported!");
25291  return NULL;
25292  }
25293  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
25294  f->m_ml->ml_name);
25295  return NULL;
25296 }
25297 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25298  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
25299 }
25300 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
25301  PyObject *result;
25302  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
25303  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
25304  Py_ssize_t argc;
25305  PyObject *new_args;
25306  PyObject *self;
25307  argc = PyTuple_GET_SIZE(args);
25308  new_args = PyTuple_GetSlice(args, 1, argc);
25309  if (unlikely(!new_args))
25310  return NULL;
25311  self = PyTuple_GetItem(args, 0);
25312  if (unlikely(!self)) {
25313  Py_DECREF(new_args);
25314  return NULL;
25315  }
25316  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
25317  Py_DECREF(new_args);
25318  } else {
25319  result = __Pyx_CyFunction_Call(func, args, kw);
25320  }
25321  return result;
25322 }
25323 static PyTypeObject __pyx_CyFunctionType_type = {
25324  PyVarObject_HEAD_INIT(0, 0)
25325  "cython_function_or_method",
25326  sizeof(__pyx_CyFunctionObject),
25327  0,
25328  (destructor) __Pyx_CyFunction_dealloc,
25329  0,
25330  0,
25331  0,
25332 #if PY_MAJOR_VERSION < 3
25333  0,
25334 #else
25335  0,
25336 #endif
25337  (reprfunc) __Pyx_CyFunction_repr,
25338  0,
25339  0,
25340  0,
25341  0,
25342  __Pyx_CyFunction_CallAsMethod,
25343  0,
25344  0,
25345  0,
25346  0,
25347  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
25348  0,
25349  (traverseproc) __Pyx_CyFunction_traverse,
25350  (inquiry) __Pyx_CyFunction_clear,
25351  0,
25352 #if PY_VERSION_HEX < 0x030500A0
25353  offsetof(__pyx_CyFunctionObject, func_weakreflist),
25354 #else
25355  offsetof(PyCFunctionObject, m_weakreflist),
25356 #endif
25357  0,
25358  0,
25359  __pyx_CyFunction_methods,
25360  __pyx_CyFunction_members,
25361  __pyx_CyFunction_getsets,
25362  0,
25363  0,
25364  __Pyx_CyFunction_descr_get,
25365  0,
25366  offsetof(__pyx_CyFunctionObject, func_dict),
25367  0,
25368  0,
25369  0,
25370  0,
25371  0,
25372  0,
25373  0,
25374  0,
25375  0,
25376  0,
25377  0,
25378  0,
25379 #if PY_VERSION_HEX >= 0x030400a1
25380  0,
25381 #endif
25382 };
25383 static int __pyx_CyFunction_init(void) {
25384  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
25385  if (unlikely(__pyx_CyFunctionType == NULL)) {
25386  return -1;
25387  }
25388  return 0;
25389 }
25390 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
25391  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25392  m->defaults = PyObject_Malloc(size);
25393  if (unlikely(!m->defaults))
25394  return PyErr_NoMemory();
25395  memset(m->defaults, 0, size);
25396  m->defaults_pyobjects = pyobjects;
25397  return m->defaults;
25398 }
25399 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
25400  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25401  m->defaults_tuple = tuple;
25402  Py_INCREF(tuple);
25403 }
25404 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
25405  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25406  m->defaults_kwdict = dict;
25407  Py_INCREF(dict);
25408 }
25409 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
25410  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25411  m->func_annotations = dict;
25412  Py_INCREF(dict);
25413 }
25414 
25415 /* SliceObject */
25416  static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
25417  Py_ssize_t cstart, Py_ssize_t cstop,
25418  PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
25419  int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
25420 #if CYTHON_USE_TYPE_SLOTS
25421  PyMappingMethods* mp;
25422 #if PY_MAJOR_VERSION < 3
25423  PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
25424  if (likely(ms && ms->sq_slice)) {
25425  if (!has_cstart) {
25426  if (_py_start && (*_py_start != Py_None)) {
25427  cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
25428  if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
25429  } else
25430  cstart = 0;
25431  }
25432  if (!has_cstop) {
25433  if (_py_stop && (*_py_stop != Py_None)) {
25434  cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
25435  if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
25436  } else
25437  cstop = PY_SSIZE_T_MAX;
25438  }
25439  if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
25440  Py_ssize_t l = ms->sq_length(obj);
25441  if (likely(l >= 0)) {
25442  if (cstop < 0) {
25443  cstop += l;
25444  if (cstop < 0) cstop = 0;
25445  }
25446  if (cstart < 0) {
25447  cstart += l;
25448  if (cstart < 0) cstart = 0;
25449  }
25450  } else {
25451  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25452  goto bad;
25453  PyErr_Clear();
25454  }
25455  }
25456  return ms->sq_slice(obj, cstart, cstop);
25457  }
25458 #endif
25459  mp = Py_TYPE(obj)->tp_as_mapping;
25460  if (likely(mp && mp->mp_subscript))
25461 #endif
25462  {
25463  PyObject* result;
25464  PyObject *py_slice, *py_start, *py_stop;
25465  if (_py_slice) {
25466  py_slice = *_py_slice;
25467  } else {
25468  PyObject* owned_start = NULL;
25469  PyObject* owned_stop = NULL;
25470  if (_py_start) {
25471  py_start = *_py_start;
25472  } else {
25473  if (has_cstart) {
25474  owned_start = py_start = PyInt_FromSsize_t(cstart);
25475  if (unlikely(!py_start)) goto bad;
25476  } else
25477  py_start = Py_None;
25478  }
25479  if (_py_stop) {
25480  py_stop = *_py_stop;
25481  } else {
25482  if (has_cstop) {
25483  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
25484  if (unlikely(!py_stop)) {
25485  Py_XDECREF(owned_start);
25486  goto bad;
25487  }
25488  } else
25489  py_stop = Py_None;
25490  }
25491  py_slice = PySlice_New(py_start, py_stop, Py_None);
25492  Py_XDECREF(owned_start);
25493  Py_XDECREF(owned_stop);
25494  if (unlikely(!py_slice)) goto bad;
25495  }
25496 #if CYTHON_USE_TYPE_SLOTS
25497  result = mp->mp_subscript(obj, py_slice);
25498 #else
25499  result = PyObject_GetItem(obj, py_slice);
25500 #endif
25501  if (!_py_slice) {
25502  Py_DECREF(py_slice);
25503  }
25504  return result;
25505  }
25506  PyErr_Format(PyExc_TypeError,
25507  "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
25508 bad:
25509  return NULL;
25510 }
25511 
25512 /* RaiseException */
25513  #if PY_MAJOR_VERSION < 3
25514 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
25515  CYTHON_UNUSED PyObject *cause) {
25516  __Pyx_PyThreadState_declare
25517  Py_XINCREF(type);
25518  if (!value || value == Py_None)
25519  value = NULL;
25520  else
25521  Py_INCREF(value);
25522  if (!tb || tb == Py_None)
25523  tb = NULL;
25524  else {
25525  Py_INCREF(tb);
25526  if (!PyTraceBack_Check(tb)) {
25527  PyErr_SetString(PyExc_TypeError,
25528  "raise: arg 3 must be a traceback or None");
25529  goto raise_error;
25530  }
25531  }
25532  if (PyType_Check(type)) {
25533 #if CYTHON_COMPILING_IN_PYPY
25534  if (!value) {
25535  Py_INCREF(Py_None);
25536  value = Py_None;
25537  }
25538 #endif
25539  PyErr_NormalizeException(&type, &value, &tb);
25540  } else {
25541  if (value) {
25542  PyErr_SetString(PyExc_TypeError,
25543  "instance exception may not have a separate value");
25544  goto raise_error;
25545  }
25546  value = type;
25547  type = (PyObject*) Py_TYPE(type);
25548  Py_INCREF(type);
25549  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
25550  PyErr_SetString(PyExc_TypeError,
25551  "raise: exception class must be a subclass of BaseException");
25552  goto raise_error;
25553  }
25554  }
25555  __Pyx_PyThreadState_assign
25556  __Pyx_ErrRestore(type, value, tb);
25557  return;
25558 raise_error:
25559  Py_XDECREF(value);
25560  Py_XDECREF(type);
25561  Py_XDECREF(tb);
25562  return;
25563 }
25564 #else
25565 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
25566  PyObject* owned_instance = NULL;
25567  if (tb == Py_None) {
25568  tb = 0;
25569  } else if (tb && !PyTraceBack_Check(tb)) {
25570  PyErr_SetString(PyExc_TypeError,
25571  "raise: arg 3 must be a traceback or None");
25572  goto bad;
25573  }
25574  if (value == Py_None)
25575  value = 0;
25576  if (PyExceptionInstance_Check(type)) {
25577  if (value) {
25578  PyErr_SetString(PyExc_TypeError,
25579  "instance exception may not have a separate value");
25580  goto bad;
25581  }
25582  value = type;
25583  type = (PyObject*) Py_TYPE(value);
25584  } else if (PyExceptionClass_Check(type)) {
25585  PyObject *instance_class = NULL;
25586  if (value && PyExceptionInstance_Check(value)) {
25587  instance_class = (PyObject*) Py_TYPE(value);
25588  if (instance_class != type) {
25589  int is_subclass = PyObject_IsSubclass(instance_class, type);
25590  if (!is_subclass) {
25591  instance_class = NULL;
25592  } else if (unlikely(is_subclass == -1)) {
25593  goto bad;
25594  } else {
25595  type = instance_class;
25596  }
25597  }
25598  }
25599  if (!instance_class) {
25600  PyObject *args;
25601  if (!value)
25602  args = PyTuple_New(0);
25603  else if (PyTuple_Check(value)) {
25604  Py_INCREF(value);
25605  args = value;
25606  } else
25607  args = PyTuple_Pack(1, value);
25608  if (!args)
25609  goto bad;
25610  owned_instance = PyObject_Call(type, args, NULL);
25611  Py_DECREF(args);
25612  if (!owned_instance)
25613  goto bad;
25614  value = owned_instance;
25615  if (!PyExceptionInstance_Check(value)) {
25616  PyErr_Format(PyExc_TypeError,
25617  "calling %R should have returned an instance of "
25618  "BaseException, not %R",
25619  type, Py_TYPE(value));
25620  goto bad;
25621  }
25622  }
25623  } else {
25624  PyErr_SetString(PyExc_TypeError,
25625  "raise: exception class must be a subclass of BaseException");
25626  goto bad;
25627  }
25628  if (cause) {
25629  PyObject *fixed_cause;
25630  if (cause == Py_None) {
25631  fixed_cause = NULL;
25632  } else if (PyExceptionClass_Check(cause)) {
25633  fixed_cause = PyObject_CallObject(cause, NULL);
25634  if (fixed_cause == NULL)
25635  goto bad;
25636  } else if (PyExceptionInstance_Check(cause)) {
25637  fixed_cause = cause;
25638  Py_INCREF(fixed_cause);
25639  } else {
25640  PyErr_SetString(PyExc_TypeError,
25641  "exception causes must derive from "
25642  "BaseException");
25643  goto bad;
25644  }
25645  PyException_SetCause(value, fixed_cause);
25646  }
25647  PyErr_SetObject(type, value);
25648  if (tb) {
25649 #if CYTHON_COMPILING_IN_PYPY
25650  PyObject *tmp_type, *tmp_value, *tmp_tb;
25651  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
25652  Py_INCREF(tb);
25653  PyErr_Restore(tmp_type, tmp_value, tb);
25654  Py_XDECREF(tmp_tb);
25655 #else
25656  PyThreadState *tstate = __Pyx_PyThreadState_Current;
25657  PyObject* tmp_tb = tstate->curexc_traceback;
25658  if (tb != tmp_tb) {
25659  Py_INCREF(tb);
25660  tstate->curexc_traceback = tb;
25661  Py_XDECREF(tmp_tb);
25662  }
25663 #endif
25664  }
25665 bad:
25666  Py_XDECREF(owned_instance);
25667  return;
25668 }
25669 #endif
25670 
25671 /* HasAttr */
25672  static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25673  PyObject *r;
25674  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25675  PyErr_SetString(PyExc_TypeError,
25676  "hasattr(): attribute name must be string");
25677  return -1;
25678  }
25679  r = __Pyx_GetAttr(o, n);
25680  if (unlikely(!r)) {
25681  PyErr_Clear();
25682  return 0;
25683  } else {
25684  Py_DECREF(r);
25685  return 1;
25686  }
25687 }
25688 
25689 /* DictGetItem */
25690  #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
25691 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
25692  PyObject *value;
25693  value = PyDict_GetItemWithError(d, key);
25694  if (unlikely(!value)) {
25695  if (!PyErr_Occurred()) {
25696  PyObject* args = PyTuple_Pack(1, key);
25697  if (likely(args))
25698  PyErr_SetObject(PyExc_KeyError, args);
25699  Py_XDECREF(args);
25700  }
25701  return NULL;
25702  }
25703  Py_INCREF(value);
25704  return value;
25705 }
25706 #endif
25707 
25708 /* RaiseTooManyValuesToUnpack */
25709  static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25710  PyErr_Format(PyExc_ValueError,
25711  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
25712 }
25713 
25714 /* RaiseNeedMoreValuesToUnpack */
25715  static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25716  PyErr_Format(PyExc_ValueError,
25717  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
25718  index, (index == 1) ? "" : "s");
25719 }
25720 
25721 /* RaiseNoneIterError */
25722  static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
25723  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
25724 }
25725 
25726 /* ExtTypeTest */
25727  static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25728  if (unlikely(!type)) {
25729  PyErr_SetString(PyExc_SystemError, "Missing type object");
25730  return 0;
25731  }
25732  if (likely(__Pyx_TypeCheck(obj, type)))
25733  return 1;
25734  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
25735  Py_TYPE(obj)->tp_name, type->tp_name);
25736  return 0;
25737 }
25738 
25739 /* SaveResetException */
25740  #if CYTHON_FAST_THREAD_STATE
25741 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25742  #if PY_VERSION_HEX >= 0x030700A3
25743  *type = tstate->exc_state.exc_type;
25744  *value = tstate->exc_state.exc_value;
25745  *tb = tstate->exc_state.exc_traceback;
25746  #else
25747  *type = tstate->exc_type;
25748  *value = tstate->exc_value;
25749  *tb = tstate->exc_traceback;
25750  #endif
25751  Py_XINCREF(*type);
25752  Py_XINCREF(*value);
25753  Py_XINCREF(*tb);
25754 }
25755 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25756  PyObject *tmp_type, *tmp_value, *tmp_tb;
25757  #if PY_VERSION_HEX >= 0x030700A3
25758  tmp_type = tstate->exc_state.exc_type;
25759  tmp_value = tstate->exc_state.exc_value;
25760  tmp_tb = tstate->exc_state.exc_traceback;
25761  tstate->exc_state.exc_type = type;
25762  tstate->exc_state.exc_value = value;
25763  tstate->exc_state.exc_traceback = tb;
25764  #else
25765  tmp_type = tstate->exc_type;
25766  tmp_value = tstate->exc_value;
25767  tmp_tb = tstate->exc_traceback;
25768  tstate->exc_type = type;
25769  tstate->exc_value = value;
25770  tstate->exc_traceback = tb;
25771  #endif
25772  Py_XDECREF(tmp_type);
25773  Py_XDECREF(tmp_value);
25774  Py_XDECREF(tmp_tb);
25775 }
25776 #endif
25777 
25778 /* GetException */
25779  #if CYTHON_FAST_THREAD_STATE
25780 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25781 #else
25782 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
25783 #endif
25784  PyObject *local_type, *local_value, *local_tb;
25785 #if CYTHON_FAST_THREAD_STATE
25786  PyObject *tmp_type, *tmp_value, *tmp_tb;
25787  local_type = tstate->curexc_type;
25788  local_value = tstate->curexc_value;
25789  local_tb = tstate->curexc_traceback;
25790  tstate->curexc_type = 0;
25791  tstate->curexc_value = 0;
25792  tstate->curexc_traceback = 0;
25793 #else
25794  PyErr_Fetch(&local_type, &local_value, &local_tb);
25795 #endif
25796  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25797 #if CYTHON_FAST_THREAD_STATE
25798  if (unlikely(tstate->curexc_type))
25799 #else
25800  if (unlikely(PyErr_Occurred()))
25801 #endif
25802  goto bad;
25803  #if PY_MAJOR_VERSION >= 3
25804  if (local_tb) {
25805  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25806  goto bad;
25807  }
25808  #endif
25809  Py_XINCREF(local_tb);
25810  Py_XINCREF(local_type);
25811  Py_XINCREF(local_value);
25812  *type = local_type;
25813  *value = local_value;
25814  *tb = local_tb;
25815 #if CYTHON_FAST_THREAD_STATE
25816  #if PY_VERSION_HEX >= 0x030700A3
25817  tmp_type = tstate->exc_state.exc_type;
25818  tmp_value = tstate->exc_state.exc_value;
25819  tmp_tb = tstate->exc_state.exc_traceback;
25820  tstate->exc_state.exc_type = local_type;
25821  tstate->exc_state.exc_value = local_value;
25822  tstate->exc_state.exc_traceback = local_tb;
25823  #else
25824  tmp_type = tstate->exc_type;
25825  tmp_value = tstate->exc_value;
25826  tmp_tb = tstate->exc_traceback;
25827  tstate->exc_type = local_type;
25828  tstate->exc_value = local_value;
25829  tstate->exc_traceback = local_tb;
25830  #endif
25831  Py_XDECREF(tmp_type);
25832  Py_XDECREF(tmp_value);
25833  Py_XDECREF(tmp_tb);
25834 #else
25835  PyErr_SetExcInfo(local_type, local_value, local_tb);
25836 #endif
25837  return 0;
25838 bad:
25839  *type = 0;
25840  *value = 0;
25841  *tb = 0;
25842  Py_XDECREF(local_type);
25843  Py_XDECREF(local_value);
25844  Py_XDECREF(local_tb);
25845  return -1;
25846 }
25847 
25848 /* ArgTypeTest */
25849  static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
25850 {
25851  if (unlikely(!type)) {
25852  PyErr_SetString(PyExc_SystemError, "Missing type object");
25853  return 0;
25854  }
25855  else if (exact) {
25856  #if PY_MAJOR_VERSION == 2
25857  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
25858  #endif
25859  }
25860  else {
25861  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
25862  }
25863  PyErr_Format(PyExc_TypeError,
25864  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
25865  name, type->tp_name, Py_TYPE(obj)->tp_name);
25866  return 0;
25867 }
25868 
25869 /* BytesEquals */
25870  static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
25871 #if CYTHON_COMPILING_IN_PYPY
25872  return PyObject_RichCompareBool(s1, s2, equals);
25873 #else
25874  if (s1 == s2) {
25875  return (equals == Py_EQ);
25876  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
25877  const char *ps1, *ps2;
25878  Py_ssize_t length = PyBytes_GET_SIZE(s1);
25879  if (length != PyBytes_GET_SIZE(s2))
25880  return (equals == Py_NE);
25881  ps1 = PyBytes_AS_STRING(s1);
25882  ps2 = PyBytes_AS_STRING(s2);
25883  if (ps1[0] != ps2[0]) {
25884  return (equals == Py_NE);
25885  } else if (length == 1) {
25886  return (equals == Py_EQ);
25887  } else {
25888  int result;
25889 #if CYTHON_USE_UNICODE_INTERNALS
25890  Py_hash_t hash1, hash2;
25891  hash1 = ((PyBytesObject*)s1)->ob_shash;
25892  hash2 = ((PyBytesObject*)s2)->ob_shash;
25893  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25894  return (equals == Py_NE);
25895  }
25896 #endif
25897  result = memcmp(ps1, ps2, (size_t)length);
25898  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25899  }
25900  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
25901  return (equals == Py_NE);
25902  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
25903  return (equals == Py_NE);
25904  } else {
25905  int result;
25906  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25907  if (!py_result)
25908  return -1;
25909  result = __Pyx_PyObject_IsTrue(py_result);
25910  Py_DECREF(py_result);
25911  return result;
25912  }
25913 #endif
25914 }
25915 
25916 /* UnicodeEquals */
25917  static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
25918 #if CYTHON_COMPILING_IN_PYPY
25919  return PyObject_RichCompareBool(s1, s2, equals);
25920 #else
25921 #if PY_MAJOR_VERSION < 3
25922  PyObject* owned_ref = NULL;
25923 #endif
25924  int s1_is_unicode, s2_is_unicode;
25925  if (s1 == s2) {
25926  goto return_eq;
25927  }
25928  s1_is_unicode = PyUnicode_CheckExact(s1);
25929  s2_is_unicode = PyUnicode_CheckExact(s2);
25930 #if PY_MAJOR_VERSION < 3
25931  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25932  owned_ref = PyUnicode_FromObject(s2);
25933  if (unlikely(!owned_ref))
25934  return -1;
25935  s2 = owned_ref;
25936  s2_is_unicode = 1;
25937  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25938  owned_ref = PyUnicode_FromObject(s1);
25939  if (unlikely(!owned_ref))
25940  return -1;
25941  s1 = owned_ref;
25942  s1_is_unicode = 1;
25943  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25944  return __Pyx_PyBytes_Equals(s1, s2, equals);
25945  }
25946 #endif
25947  if (s1_is_unicode & s2_is_unicode) {
25948  Py_ssize_t length;
25949  int kind;
25950  void *data1, *data2;
25951  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25952  return -1;
25953  length = __Pyx_PyUnicode_GET_LENGTH(s1);
25954  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25955  goto return_ne;
25956  }
25957 #if CYTHON_USE_UNICODE_INTERNALS
25958  {
25959  Py_hash_t hash1, hash2;
25960  #if CYTHON_PEP393_ENABLED
25961  hash1 = ((PyASCIIObject*)s1)->hash;
25962  hash2 = ((PyASCIIObject*)s2)->hash;
25963  #else
25964  hash1 = ((PyUnicodeObject*)s1)->hash;
25965  hash2 = ((PyUnicodeObject*)s2)->hash;
25966  #endif
25967  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25968  goto return_ne;
25969  }
25970  }
25971 #endif
25972  kind = __Pyx_PyUnicode_KIND(s1);
25973  if (kind != __Pyx_PyUnicode_KIND(s2)) {
25974  goto return_ne;
25975  }
25976  data1 = __Pyx_PyUnicode_DATA(s1);
25977  data2 = __Pyx_PyUnicode_DATA(s2);
25978  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25979  goto return_ne;
25980  } else if (length == 1) {
25981  goto return_eq;
25982  } else {
25983  int result = memcmp(data1, data2, (size_t)(length * kind));
25984  #if PY_MAJOR_VERSION < 3
25985  Py_XDECREF(owned_ref);
25986  #endif
25987  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25988  }
25989  } else if ((s1 == Py_None) & s2_is_unicode) {
25990  goto return_ne;
25991  } else if ((s2 == Py_None) & s1_is_unicode) {
25992  goto return_ne;
25993  } else {
25994  int result;
25995  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25996  #if PY_MAJOR_VERSION < 3
25997  Py_XDECREF(owned_ref);
25998  #endif
25999  if (!py_result)
26000  return -1;
26001  result = __Pyx_PyObject_IsTrue(py_result);
26002  Py_DECREF(py_result);
26003  return result;
26004  }
26005 return_eq:
26006  #if PY_MAJOR_VERSION < 3
26007  Py_XDECREF(owned_ref);
26008  #endif
26009  return (equals == Py_EQ);
26010 return_ne:
26011  #if PY_MAJOR_VERSION < 3
26012  Py_XDECREF(owned_ref);
26013  #endif
26014  return (equals == Py_NE);
26015 #endif
26016 }
26017 
26018 /* None */
26019  static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
26020  Py_ssize_t q = a / b;
26021  Py_ssize_t r = a - q*b;
26022  q -= ((r != 0) & ((r ^ b) < 0));
26023  return q;
26024 }
26025 
26026 /* decode_c_string */
26027  static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
26028  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
26029  const char* encoding, const char* errors,
26030  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
26031  Py_ssize_t length;
26032  if (unlikely((start < 0) | (stop < 0))) {
26033  size_t slen = strlen(cstring);
26034  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
26035  PyErr_SetString(PyExc_OverflowError,
26036  "c-string too long to convert to Python");
26037  return NULL;
26038  }
26039  length = (Py_ssize_t) slen;
26040  if (start < 0) {
26041  start += length;
26042  if (start < 0)
26043  start = 0;
26044  }
26045  if (stop < 0)
26046  stop += length;
26047  }
26048  length = stop - start;
26049  if (unlikely(length <= 0))
26050  return PyUnicode_FromUnicode(NULL, 0);
26051  cstring += start;
26052  if (decode_func) {
26053  return decode_func(cstring, length, errors);
26054  } else {
26055  return PyUnicode_Decode(cstring, length, encoding, errors);
26056  }
26057 }
26058 
26059 /* SwapException */
26060  #if CYTHON_FAST_THREAD_STATE
26061 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26062  PyObject *tmp_type, *tmp_value, *tmp_tb;
26063  #if PY_VERSION_HEX >= 0x030700A3
26064  tmp_type = tstate->exc_state.exc_type;
26065  tmp_value = tstate->exc_state.exc_value;
26066  tmp_tb = tstate->exc_state.exc_traceback;
26067  tstate->exc_state.exc_type = *type;
26068  tstate->exc_state.exc_value = *value;
26069  tstate->exc_state.exc_traceback = *tb;
26070  #else
26071  tmp_type = tstate->exc_type;
26072  tmp_value = tstate->exc_value;
26073  tmp_tb = tstate->exc_traceback;
26074  tstate->exc_type = *type;
26075  tstate->exc_value = *value;
26076  tstate->exc_traceback = *tb;
26077  #endif
26078  *type = tmp_type;
26079  *value = tmp_value;
26080  *tb = tmp_tb;
26081 }
26082 #else
26083 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
26084  PyObject *tmp_type, *tmp_value, *tmp_tb;
26085  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
26086  PyErr_SetExcInfo(*type, *value, *tb);
26087  *type = tmp_type;
26088  *value = tmp_value;
26089  *tb = tmp_tb;
26090 }
26091 #endif
26092 
26093 /* FastTypeChecks */
26094  #if CYTHON_COMPILING_IN_CPYTHON
26095 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
26096  while (a) {
26097  a = a->tp_base;
26098  if (a == b)
26099  return 1;
26100  }
26101  return b == &PyBaseObject_Type;
26102 }
26103 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
26104  PyObject *mro;
26105  if (a == b) return 1;
26106  mro = a->tp_mro;
26107  if (likely(mro)) {
26108  Py_ssize_t i, n;
26109  n = PyTuple_GET_SIZE(mro);
26110  for (i = 0; i < n; i++) {
26111  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26112  return 1;
26113  }
26114  return 0;
26115  }
26116  return __Pyx_InBases(a, b);
26117 }
26118 #if PY_MAJOR_VERSION == 2
26119 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
26120  PyObject *exception, *value, *tb;
26121  int res;
26122  __Pyx_PyThreadState_declare
26123  __Pyx_PyThreadState_assign
26124  __Pyx_ErrFetch(&exception, &value, &tb);
26125  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
26126  if (unlikely(res == -1)) {
26127  PyErr_WriteUnraisable(err);
26128  res = 0;
26129  }
26130  if (!res) {
26131  res = PyObject_IsSubclass(err, exc_type2);
26132  if (unlikely(res == -1)) {
26133  PyErr_WriteUnraisable(err);
26134  res = 0;
26135  }
26136  }
26137  __Pyx_ErrRestore(exception, value, tb);
26138  return res;
26139 }
26140 #else
26141 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
26142  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
26143  if (!res) {
26144  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
26145  }
26146  return res;
26147 }
26148 #endif
26149 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26150  Py_ssize_t i, n;
26151  assert(PyExceptionClass_Check(exc_type));
26152  n = PyTuple_GET_SIZE(tuple);
26153 #if PY_MAJOR_VERSION >= 3
26154  for (i=0; i<n; i++) {
26155  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
26156  }
26157 #endif
26158  for (i=0; i<n; i++) {
26159  PyObject *t = PyTuple_GET_ITEM(tuple, i);
26160  #if PY_MAJOR_VERSION < 3
26161  if (likely(exc_type == t)) return 1;
26162  #endif
26163  if (likely(PyExceptionClass_Check(t))) {
26164  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
26165  } else {
26166  }
26167  }
26168  return 0;
26169 }
26170 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
26171  if (likely(err == exc_type)) return 1;
26172  if (likely(PyExceptionClass_Check(err))) {
26173  if (likely(PyExceptionClass_Check(exc_type))) {
26174  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
26175  } else if (likely(PyTuple_Check(exc_type))) {
26176  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
26177  } else {
26178  }
26179  }
26180  return PyErr_GivenExceptionMatches(err, exc_type);
26181 }
26182 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
26183  assert(PyExceptionClass_Check(exc_type1));
26184  assert(PyExceptionClass_Check(exc_type2));
26185  if (likely(err == exc_type1 || err == exc_type2)) return 1;
26186  if (likely(PyExceptionClass_Check(err))) {
26187  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
26188  }
26189  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
26190 }
26191 #endif
26192 
26193 /* PyIntBinop */
26194  #if !CYTHON_COMPILING_IN_PYPY
26195 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
26196  #if PY_MAJOR_VERSION < 3
26197  if (likely(PyInt_CheckExact(op1))) {
26198  const long b = intval;
26199  long x;
26200  long a = PyInt_AS_LONG(op1);
26201  x = (long)((unsigned long)a + b);
26202  if (likely((x^a) >= 0 || (x^b) >= 0))
26203  return PyInt_FromLong(x);
26204  return PyLong_Type.tp_as_number->nb_add(op1, op2);
26205  }
26206  #endif
26207  #if CYTHON_USE_PYLONG_INTERNALS
26208  if (likely(PyLong_CheckExact(op1))) {
26209  const long b = intval;
26210  long a, x;
26211 #ifdef HAVE_LONG_LONG
26212  const PY_LONG_LONG llb = intval;
26213  PY_LONG_LONG lla, llx;
26214 #endif
26215  const digit* digits = ((PyLongObject*)op1)->ob_digit;
26216  const Py_ssize_t size = Py_SIZE(op1);
26217  if (likely(__Pyx_sst_abs(size) <= 1)) {
26218  a = likely(size) ? digits[0] : 0;
26219  if (size == -1) a = -a;
26220  } else {
26221  switch (size) {
26222  case -2:
26223  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26224  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26225  break;
26226 #ifdef HAVE_LONG_LONG
26227  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26228  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26229  goto long_long;
26230 #endif
26231  }
26232  CYTHON_FALLTHROUGH;
26233  case 2:
26234  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26235  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26236  break;
26237 #ifdef HAVE_LONG_LONG
26238  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26239  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26240  goto long_long;
26241 #endif
26242  }
26243  CYTHON_FALLTHROUGH;
26244  case -3:
26245  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26246  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26247  break;
26248 #ifdef HAVE_LONG_LONG
26249  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26250  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26251  goto long_long;
26252 #endif
26253  }
26254  CYTHON_FALLTHROUGH;
26255  case 3:
26256  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26257  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26258  break;
26259 #ifdef HAVE_LONG_LONG
26260  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26261  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26262  goto long_long;
26263 #endif
26264  }
26265  CYTHON_FALLTHROUGH;
26266  case -4:
26267  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26268  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26269  break;
26270 #ifdef HAVE_LONG_LONG
26271  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26272  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26273  goto long_long;
26274 #endif
26275  }
26276  CYTHON_FALLTHROUGH;
26277  case 4:
26278  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26279  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26280  break;
26281 #ifdef HAVE_LONG_LONG
26282  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26283  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26284  goto long_long;
26285 #endif
26286  }
26287  CYTHON_FALLTHROUGH;
26288  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
26289  }
26290  }
26291  x = a + b;
26292  return PyLong_FromLong(x);
26293 #ifdef HAVE_LONG_LONG
26294  long_long:
26295  llx = lla + llb;
26296  return PyLong_FromLongLong(llx);
26297 #endif
26298 
26299 
26300  }
26301  #endif
26302  if (PyFloat_CheckExact(op1)) {
26303  const long b = intval;
26304  double a = PyFloat_AS_DOUBLE(op1);
26305  double result;
26306  PyFPE_START_PROTECT("add", return NULL)
26307  result = ((double)a) + (double)b;
26308  PyFPE_END_PROTECT(result)
26309  return PyFloat_FromDouble(result);
26310  }
26311  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
26312 }
26313 #endif
26314 
26315 /* None */
26316  static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
26317  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
26318 }
26319 
26320 /* None */
26321  static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
26322  long q = a / b;
26323  long r = a - q*b;
26324  q -= ((r != 0) & ((r ^ b) < 0));
26325  return q;
26326 }
26327 
26328 /* PyObject_GenericGetAttrNoDict */
26329  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26330 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
26331  PyErr_Format(PyExc_AttributeError,
26332 #if PY_MAJOR_VERSION >= 3
26333  "'%.50s' object has no attribute '%U'",
26334  tp->tp_name, attr_name);
26335 #else
26336  "'%.50s' object has no attribute '%.400s'",
26337  tp->tp_name, PyString_AS_STRING(attr_name));
26338 #endif
26339  return NULL;
26340 }
26341 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
26342  PyObject *descr;
26343  PyTypeObject *tp = Py_TYPE(obj);
26344  if (unlikely(!PyString_Check(attr_name))) {
26345  return PyObject_GenericGetAttr(obj, attr_name);
26346  }
26347  assert(!tp->tp_dictoffset);
26348  descr = _PyType_Lookup(tp, attr_name);
26349  if (unlikely(!descr)) {
26350  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
26351  }
26352  Py_INCREF(descr);
26353  #if PY_MAJOR_VERSION < 3
26354  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
26355  #endif
26356  {
26357  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
26358  if (unlikely(f)) {
26359  PyObject *res = f(descr, obj, (PyObject *)tp);
26360  Py_DECREF(descr);
26361  return res;
26362  }
26363  }
26364  return descr;
26365 }
26366 #endif
26367 
26368 /* PyObject_GenericGetAttr */
26369  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26370 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
26371  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
26372  return PyObject_GenericGetAttr(obj, attr_name);
26373  }
26374  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
26375 }
26376 #endif
26377 
26378 /* SetupReduce */
26379  static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
26380  int ret;
26381  PyObject *name_attr;
26382  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
26383  if (likely(name_attr)) {
26384  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
26385  } else {
26386  ret = -1;
26387  }
26388  if (unlikely(ret < 0)) {
26389  PyErr_Clear();
26390  ret = 0;
26391  }
26392  Py_XDECREF(name_attr);
26393  return ret;
26394 }
26395 static int __Pyx_setup_reduce(PyObject* type_obj) {
26396  int ret = 0;
26397  PyObject *object_reduce = NULL;
26398  PyObject *object_reduce_ex = NULL;
26399  PyObject *reduce = NULL;
26400  PyObject *reduce_ex = NULL;
26401  PyObject *reduce_cython = NULL;
26402  PyObject *setstate = NULL;
26403  PyObject *setstate_cython = NULL;
26404 #if CYTHON_USE_PYTYPE_LOOKUP
26405  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
26406 #else
26407  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
26408 #endif
26409 #if CYTHON_USE_PYTYPE_LOOKUP
26410  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
26411 #else
26412  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
26413 #endif
26414  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
26415  if (reduce_ex == object_reduce_ex) {
26416 #if CYTHON_USE_PYTYPE_LOOKUP
26417  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
26418 #else
26419  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
26420 #endif
26421  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
26422  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
26423  reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
26424  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
26425  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
26426  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
26427  if (!setstate) PyErr_Clear();
26428  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
26429  setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
26430  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
26431  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
26432  }
26433  PyType_Modified((PyTypeObject*)type_obj);
26434  }
26435  }
26436  goto GOOD;
26437 BAD:
26438  if (!PyErr_Occurred())
26439  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26440  ret = -1;
26441 GOOD:
26442 #if !CYTHON_USE_PYTYPE_LOOKUP
26443  Py_XDECREF(object_reduce);
26444  Py_XDECREF(object_reduce_ex);
26445 #endif
26446  Py_XDECREF(reduce);
26447  Py_XDECREF(reduce_ex);
26448  Py_XDECREF(reduce_cython);
26449  Py_XDECREF(setstate);
26450  Py_XDECREF(setstate_cython);
26451  return ret;
26452 }
26453 
26454 /* SetVTable */
26455  static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
26456 #if PY_VERSION_HEX >= 0x02070000
26457  PyObject *ob = PyCapsule_New(vtable, 0, 0);
26458 #else
26459  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26460 #endif
26461  if (!ob)
26462  goto bad;
26463  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
26464  goto bad;
26465  Py_DECREF(ob);
26466  return 0;
26467 bad:
26468  Py_XDECREF(ob);
26469  return -1;
26470 }
26471 
26472 /* CLineInTraceback */
26473  #ifndef CYTHON_CLINE_IN_TRACEBACK
26474 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
26475  PyObject *use_cline;
26476  PyObject *ptype, *pvalue, *ptraceback;
26477 #if CYTHON_COMPILING_IN_CPYTHON
26478  PyObject **cython_runtime_dict;
26479 #endif
26480  if (unlikely(!__pyx_cython_runtime)) {
26481  return c_line;
26482  }
26483  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26484 #if CYTHON_COMPILING_IN_CPYTHON
26485  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26486  if (likely(cython_runtime_dict)) {
26487  use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
26488  } else
26489 #endif
26490  {
26491  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26492  if (use_cline_obj) {
26493  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26494  Py_DECREF(use_cline_obj);
26495  } else {
26496  PyErr_Clear();
26497  use_cline = NULL;
26498  }
26499  }
26500  if (!use_cline) {
26501  c_line = 0;
26502  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26503  }
26504  else if (PyObject_Not(use_cline) != 0) {
26505  c_line = 0;
26506  }
26507  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26508  return c_line;
26509 }
26510 #endif
26511 
26512 /* CodeObjectCache */
26513  static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
26514  int start = 0, mid = 0, end = count - 1;
26515  if (end >= 0 && code_line > entries[end].code_line) {
26516  return count;
26517  }
26518  while (start < end) {
26519  mid = start + (end - start) / 2;
26520  if (code_line < entries[mid].code_line) {
26521  end = mid;
26522  } else if (code_line > entries[mid].code_line) {
26523  start = mid + 1;
26524  } else {
26525  return mid;
26526  }
26527  }
26528  if (code_line <= entries[mid].code_line) {
26529  return mid;
26530  } else {
26531  return mid + 1;
26532  }
26533 }
26534 static PyCodeObject *__pyx_find_code_object(int code_line) {
26535  PyCodeObject* code_object;
26536  int pos;
26537  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26538  return NULL;
26539  }
26540  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26541  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
26542  return NULL;
26543  }
26544  code_object = __pyx_code_cache.entries[pos].code_object;
26545  Py_INCREF(code_object);
26546  return code_object;
26547 }
26548 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
26549  int pos, i;
26550  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26551  if (unlikely(!code_line)) {
26552  return;
26553  }
26554  if (unlikely(!entries)) {
26555  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
26556  if (likely(entries)) {
26557  __pyx_code_cache.entries = entries;
26558  __pyx_code_cache.max_count = 64;
26559  __pyx_code_cache.count = 1;
26560  entries[0].code_line = code_line;
26561  entries[0].code_object = code_object;
26562  Py_INCREF(code_object);
26563  }
26564  return;
26565  }
26566  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26567  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26568  PyCodeObject* tmp = entries[pos].code_object;
26569  entries[pos].code_object = code_object;
26570  Py_DECREF(tmp);
26571  return;
26572  }
26573  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26574  int new_max = __pyx_code_cache.max_count + 64;
26575  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26576  __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
26577  if (unlikely(!entries)) {
26578  return;
26579  }
26580  __pyx_code_cache.entries = entries;
26581  __pyx_code_cache.max_count = new_max;
26582  }
26583  for (i=__pyx_code_cache.count; i>pos; i--) {
26584  entries[i] = entries[i-1];
26585  }
26586  entries[pos].code_line = code_line;
26587  entries[pos].code_object = code_object;
26588  __pyx_code_cache.count++;
26589  Py_INCREF(code_object);
26590 }
26591 
26592 /* AddTraceback */
26593  #include "compile.h"
26594 #include "frameobject.h"
26595 #include "traceback.h"
26596 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26597  const char *funcname, int c_line,
26598  int py_line, const char *filename) {
26599  PyCodeObject *py_code = 0;
26600  PyObject *py_srcfile = 0;
26601  PyObject *py_funcname = 0;
26602  #if PY_MAJOR_VERSION < 3
26603  py_srcfile = PyString_FromString(filename);
26604  #else
26605  py_srcfile = PyUnicode_FromString(filename);
26606  #endif
26607  if (!py_srcfile) goto bad;
26608  if (c_line) {
26609  #if PY_MAJOR_VERSION < 3
26610  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26611  #else
26612  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26613  #endif
26614  }
26615  else {
26616  #if PY_MAJOR_VERSION < 3
26617  py_funcname = PyString_FromString(funcname);
26618  #else
26619  py_funcname = PyUnicode_FromString(funcname);
26620  #endif
26621  }
26622  if (!py_funcname) goto bad;
26623  py_code = __Pyx_PyCode_New(
26624  0,
26625  0,
26626  0,
26627  0,
26628  0,
26629  __pyx_empty_bytes, /*PyObject *code,*/
26630  __pyx_empty_tuple, /*PyObject *consts,*/
26631  __pyx_empty_tuple, /*PyObject *names,*/
26632  __pyx_empty_tuple, /*PyObject *varnames,*/
26633  __pyx_empty_tuple, /*PyObject *freevars,*/
26634  __pyx_empty_tuple, /*PyObject *cellvars,*/
26635  py_srcfile, /*PyObject *filename,*/
26636  py_funcname, /*PyObject *name,*/
26637  py_line,
26638  __pyx_empty_bytes /*PyObject *lnotab*/
26639  );
26640  Py_DECREF(py_srcfile);
26641  Py_DECREF(py_funcname);
26642  return py_code;
26643 bad:
26644  Py_XDECREF(py_srcfile);
26645  Py_XDECREF(py_funcname);
26646  return NULL;
26647 }
26648 static void __Pyx_AddTraceback(const char *funcname, int c_line,
26649  int py_line, const char *filename) {
26650  PyCodeObject *py_code = 0;
26651  PyFrameObject *py_frame = 0;
26652  PyThreadState *tstate = __Pyx_PyThreadState_Current;
26653  if (c_line) {
26654  c_line = __Pyx_CLineForTraceback(tstate, c_line);
26655  }
26656  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26657  if (!py_code) {
26658  py_code = __Pyx_CreateCodeObjectForTraceback(
26659  funcname, c_line, py_line, filename);
26660  if (!py_code) goto bad;
26661  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26662  }
26663  py_frame = PyFrame_New(
26664  tstate, /*PyThreadState *tstate,*/
26665  py_code, /*PyCodeObject *code,*/
26666  __pyx_d, /*PyObject *globals,*/
26667  0 /*PyObject *locals*/
26668  );
26669  if (!py_frame) goto bad;
26670  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26671  PyTraceBack_Here(py_frame);
26672 bad:
26673  Py_XDECREF(py_code);
26674  Py_XDECREF(py_frame);
26675 }
26676 
26677 #if PY_MAJOR_VERSION < 3
26678 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
26679  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
26680  if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
26681  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
26682  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
26683  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26684  return -1;
26685 }
26686 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26687  PyObject *obj = view->obj;
26688  if (!obj) return;
26689  if (PyObject_CheckBuffer(obj)) {
26690  PyBuffer_Release(view);
26691  return;
26692  }
26693  if ((0)) {}
26694  else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
26695  view->obj = NULL;
26696  Py_DECREF(obj);
26697 }
26698 #endif
26699 
26700 
26701  /* MemviewSliceIsContig */
26702  static int
26703 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
26704 {
26705  int i, index, step, start;
26706  Py_ssize_t itemsize = mvs.memview->view.itemsize;
26707  if (order == 'F') {
26708  step = 1;
26709  start = 0;
26710  } else {
26711  step = -1;
26712  start = ndim - 1;
26713  }
26714  for (i = 0; i < ndim; i++) {
26715  index = start + step * i;
26716  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26717  return 0;
26718  itemsize *= mvs.shape[index];
26719  }
26720  return 1;
26721 }
26722 
26723 /* OverlappingSlices */
26724  static void
26725 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26726  void **out_start, void **out_end,
26727  int ndim, size_t itemsize)
26728 {
26729  char *start, *end;
26730  int i;
26731  start = end = slice->data;
26732  for (i = 0; i < ndim; i++) {
26733  Py_ssize_t stride = slice->strides[i];
26734  Py_ssize_t extent = slice->shape[i];
26735  if (extent == 0) {
26736  *out_start = *out_end = start;
26737  return;
26738  } else {
26739  if (stride > 0)
26740  end += stride * (extent - 1);
26741  else
26742  start += stride * (extent - 1);
26743  }
26744  }
26745  *out_start = start;
26746  *out_end = end + itemsize;
26747 }
26748 static int
26749 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26750  __Pyx_memviewslice *slice2,
26751  int ndim, size_t itemsize)
26752 {
26753  void *start1, *end1, *start2, *end2;
26754  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26755  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26756  return (start1 < end2) && (start2 < end1);
26757 }
26758 
26759 /* Capsule */
26760  static CYTHON_INLINE PyObject *
26761 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
26762 {
26763  PyObject *cobj;
26764 #if PY_VERSION_HEX >= 0x02070000
26765  cobj = PyCapsule_New(p, sig, NULL);
26766 #else
26767  cobj = PyCObject_FromVoidPtr(p, NULL);
26768 #endif
26769  return cobj;
26770 }
26771 
26772 /* MemviewDtypeToObject */
26773  static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
26774  return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
26775 }
26776 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
26777  double value = __pyx_PyFloat_AsDouble(obj);
26778  if ((value == (double)-1) && PyErr_Occurred())
26779  return 0;
26780  *(double *) itemp = value;
26781  return 1;
26782 }
26783 
26784 /* IsLittleEndian */
26785  static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
26786 {
26787  union {
26788  uint32_t u32;
26789  uint8_t u8[4];
26790  } S;
26791  S.u32 = 0x01020304;
26792  return S.u8[0] == 4;
26793 }
26794 
26795 /* BufferFormatCheck */
26796  static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
26797  __Pyx_BufFmt_StackElem* stack,
26798  __Pyx_TypeInfo* type) {
26799  stack[0].field = &ctx->root;
26800  stack[0].parent_offset = 0;
26801  ctx->root.type = type;
26802  ctx->root.name = "buffer dtype";
26803  ctx->root.offset = 0;
26804  ctx->head = stack;
26805  ctx->head->field = &ctx->root;
26806  ctx->fmt_offset = 0;
26807  ctx->head->parent_offset = 0;
26808  ctx->new_packmode = '@';
26809  ctx->enc_packmode = '@';
26810  ctx->new_count = 1;
26811  ctx->enc_count = 0;
26812  ctx->enc_type = 0;
26813  ctx->is_complex = 0;
26814  ctx->is_valid_array = 0;
26815  ctx->struct_alignment = 0;
26816  while (type->typegroup == 'S') {
26817  ++ctx->head;
26818  ctx->head->field = type->fields;
26819  ctx->head->parent_offset = 0;
26820  type = type->fields->type;
26821  }
26822 }
26823 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
26824  int count;
26825  const char* t = *ts;
26826  if (*t < '0' || *t > '9') {
26827  return -1;
26828  } else {
26829  count = *t++ - '0';
26830  while (*t >= '0' && *t < '9') {
26831  count *= 10;
26832  count += *t++ - '0';
26833  }
26834  }
26835  *ts = t;
26836  return count;
26837 }
26838 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
26839  int number = __Pyx_BufFmt_ParseNumber(ts);
26840  if (number == -1)
26841  PyErr_Format(PyExc_ValueError,\
26842  "Does not understand character buffer dtype format string ('%c')", **ts);
26843  return number;
26844 }
26845 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
26846  PyErr_Format(PyExc_ValueError,
26847  "Unexpected format string character: '%c'", ch);
26848 }
26849 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
26850  switch (ch) {
26851  case 'c': return "'char'";
26852  case 'b': return "'signed char'";
26853  case 'B': return "'unsigned char'";
26854  case 'h': return "'short'";
26855  case 'H': return "'unsigned short'";
26856  case 'i': return "'int'";
26857  case 'I': return "'unsigned int'";
26858  case 'l': return "'long'";
26859  case 'L': return "'unsigned long'";
26860  case 'q': return "'long long'";
26861  case 'Q': return "'unsigned long long'";
26862  case 'f': return (is_complex ? "'complex float'" : "'float'");
26863  case 'd': return (is_complex ? "'complex double'" : "'double'");
26864  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
26865  case 'T': return "a struct";
26866  case 'O': return "Python object";
26867  case 'P': return "a pointer";
26868  case 's': case 'p': return "a string";
26869  case 0: return "end";
26870  default: return "unparseable format string";
26871  }
26872 }
26873 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
26874  switch (ch) {
26875  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26876  case 'h': case 'H': return 2;
26877  case 'i': case 'I': case 'l': case 'L': return 4;
26878  case 'q': case 'Q': return 8;
26879  case 'f': return (is_complex ? 8 : 4);
26880  case 'd': return (is_complex ? 16 : 8);
26881  case 'g': {
26882  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
26883  return 0;
26884  }
26885  case 'O': case 'P': return sizeof(void*);
26886  default:
26887  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26888  return 0;
26889  }
26890 }
26891 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
26892  switch (ch) {
26893  case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26894  case 'h': case 'H': return sizeof(short);
26895  case 'i': case 'I': return sizeof(int);
26896  case 'l': case 'L': return sizeof(long);
26897  #ifdef HAVE_LONG_LONG
26898  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
26899  #endif
26900  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
26901  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
26902  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
26903  case 'O': case 'P': return sizeof(void*);
26904  default: {
26905  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26906  return 0;
26907  }
26908  }
26909 }
26910 typedef struct { char c; short x; } __Pyx_st_short;
26911 typedef struct { char c; int x; } __Pyx_st_int;
26912 typedef struct { char c; long x; } __Pyx_st_long;
26913 typedef struct { char c; float x; } __Pyx_st_float;
26914 typedef struct { char c; double x; } __Pyx_st_double;
26915 typedef struct { char c; long double x; } __Pyx_st_longdouble;
26916 typedef struct { char c; void *x; } __Pyx_st_void_p;
26917 #ifdef HAVE_LONG_LONG
26918 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
26919 #endif
26920 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
26921  switch (ch) {
26922  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26923  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
26924  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
26925  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
26926 #ifdef HAVE_LONG_LONG
26927  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
26928 #endif
26929  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
26930  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
26931  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
26932  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
26933  default:
26934  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26935  return 0;
26936  }
26937 }
26938 /* These are for computing the padding at the end of the struct to align
26939  on the first member of the struct. This will probably the same as above,
26940  but we don't have any guarantees.
26941  */
26942 typedef struct { short x; char c; } __Pyx_pad_short;
26943 typedef struct { int x; char c; } __Pyx_pad_int;
26944 typedef struct { long x; char c; } __Pyx_pad_long;
26945 typedef struct { float x; char c; } __Pyx_pad_float;
26946 typedef struct { double x; char c; } __Pyx_pad_double;
26947 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
26948 typedef struct { void *x; char c; } __Pyx_pad_void_p;
26949 #ifdef HAVE_LONG_LONG
26950 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
26951 #endif
26952 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
26953  switch (ch) {
26954  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26955  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
26956  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
26957  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
26958 #ifdef HAVE_LONG_LONG
26959  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
26960 #endif
26961  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
26962  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
26963  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
26964  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
26965  default:
26966  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26967  return 0;
26968  }
26969 }
26970 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
26971  switch (ch) {
26972  case 'c':
26973  return 'H';
26974  case 'b': case 'h': case 'i':
26975  case 'l': case 'q': case 's': case 'p':
26976  return 'I';
26977  case 'B': case 'H': case 'I': case 'L': case 'Q':
26978  return 'U';
26979  case 'f': case 'd': case 'g':
26980  return (is_complex ? 'C' : 'R');
26981  case 'O':
26982  return 'O';
26983  case 'P':
26984  return 'P';
26985  default: {
26986  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26987  return 0;
26988  }
26989  }
26990 }
26991 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26992  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26993  const char* expected;
26994  const char* quote;
26995  if (ctx->head == NULL) {
26996  expected = "end";
26997  quote = "";
26998  } else {
26999  expected = ctx->head->field->type->name;
27000  quote = "'";
27001  }
27002  PyErr_Format(PyExc_ValueError,
27003  "Buffer dtype mismatch, expected %s%s%s but got %s",
27004  quote, expected, quote,
27005  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
27006  } else {
27007  __Pyx_StructField* field = ctx->head->field;
27008  __Pyx_StructField* parent = (ctx->head - 1)->field;
27009  PyErr_Format(PyExc_ValueError,
27010  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
27011  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
27012  parent->type->name, field->name);
27013  }
27014 }
27015 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
27016  char group;
27017  size_t size, offset, arraysize = 1;
27018  if (ctx->enc_type == 0) return 0;
27019  if (ctx->head->field->type->arraysize[0]) {
27020  int i, ndim = 0;
27021  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
27022  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
27023  ndim = 1;
27024  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
27025  PyErr_Format(PyExc_ValueError,
27026  "Expected a dimension of size %zu, got %zu",
27027  ctx->head->field->type->arraysize[0], ctx->enc_count);
27028  return -1;
27029  }
27030  }
27031  if (!ctx->is_valid_array) {
27032  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
27033  ctx->head->field->type->ndim, ndim);
27034  return -1;
27035  }
27036  for (i = 0; i < ctx->head->field->type->ndim; i++) {
27037  arraysize *= ctx->head->field->type->arraysize[i];
27038  }
27039  ctx->is_valid_array = 0;
27040  ctx->enc_count = 1;
27041  }
27042  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
27043  do {
27044  __Pyx_StructField* field = ctx->head->field;
27045  __Pyx_TypeInfo* type = field->type;
27046  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
27047  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
27048  } else {
27049  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
27050  }
27051  if (ctx->enc_packmode == '@') {
27052  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
27053  size_t align_mod_offset;
27054  if (align_at == 0) return -1;
27055  align_mod_offset = ctx->fmt_offset % align_at;
27056  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
27057  if (ctx->struct_alignment == 0)
27058  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
27059  ctx->is_complex);
27060  }
27061  if (type->size != size || type->typegroup != group) {
27062  if (type->typegroup == 'C' && type->fields != NULL) {
27063  size_t parent_offset = ctx->head->parent_offset + field->offset;
27064  ++ctx->head;
27065  ctx->head->field = type->fields;
27066  ctx->head->parent_offset = parent_offset;
27067  continue;
27068  }
27069  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
27070  } else {
27071  __Pyx_BufFmt_RaiseExpected(ctx);
27072  return -1;
27073  }
27074  }
27075  offset = ctx->head->parent_offset + field->offset;
27076  if (ctx->fmt_offset != offset) {
27077  PyErr_Format(PyExc_ValueError,
27078  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
27079  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
27080  return -1;
27081  }
27082  ctx->fmt_offset += size;
27083  if (arraysize)
27084  ctx->fmt_offset += (arraysize - 1) * size;
27085  --ctx->enc_count;
27086  while (1) {
27087  if (field == &ctx->root) {
27088  ctx->head = NULL;
27089  if (ctx->enc_count != 0) {
27090  __Pyx_BufFmt_RaiseExpected(ctx);
27091  return -1;
27092  }
27093  break;
27094  }
27095  ctx->head->field = ++field;
27096  if (field->type == NULL) {
27097  --ctx->head;
27098  field = ctx->head->field;
27099  continue;
27100  } else if (field->type->typegroup == 'S') {
27101  size_t parent_offset = ctx->head->parent_offset + field->offset;
27102  if (field->type->fields->type == NULL) continue;
27103  field = field->type->fields;
27104  ++ctx->head;
27105  ctx->head->field = field;
27106  ctx->head->parent_offset = parent_offset;
27107  break;
27108  } else {
27109  break;
27110  }
27111  }
27112  } while (ctx->enc_count);
27113  ctx->enc_type = 0;
27114  ctx->is_complex = 0;
27115  return 0;
27116 }
27117 static PyObject *
27118 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
27119 {
27120  const char *ts = *tsp;
27121  int i = 0, number;
27122  int ndim = ctx->head->field->type->ndim;
27123 ;
27124  ++ts;
27125  if (ctx->new_count != 1) {
27126  PyErr_SetString(PyExc_ValueError,
27127  "Cannot handle repeated arrays in format string");
27128  return NULL;
27129  }
27130  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27131  while (*ts && *ts != ')') {
27132  switch (*ts) {
27133  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
27134  default: break;
27135  }
27136  number = __Pyx_BufFmt_ExpectNumber(&ts);
27137  if (number == -1) return NULL;
27138  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
27139  return PyErr_Format(PyExc_ValueError,
27140  "Expected a dimension of size %zu, got %d",
27141  ctx->head->field->type->arraysize[i], number);
27142  if (*ts != ',' && *ts != ')')
27143  return PyErr_Format(PyExc_ValueError,
27144  "Expected a comma in format string, got '%c'", *ts);
27145  if (*ts == ',') ts++;
27146  i++;
27147  }
27148  if (i != ndim)
27149  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
27150  ctx->head->field->type->ndim, i);
27151  if (!*ts) {
27152  PyErr_SetString(PyExc_ValueError,
27153  "Unexpected end of format string, expected ')'");
27154  return NULL;
27155  }
27156  ctx->is_valid_array = 1;
27157  ctx->new_count = 1;
27158  *tsp = ++ts;
27159  return Py_None;
27160 }
27161 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
27162  int got_Z = 0;
27163  while (1) {
27164  switch(*ts) {
27165  case 0:
27166  if (ctx->enc_type != 0 && ctx->head == NULL) {
27167  __Pyx_BufFmt_RaiseExpected(ctx);
27168  return NULL;
27169  }
27170  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27171  if (ctx->head != NULL) {
27172  __Pyx_BufFmt_RaiseExpected(ctx);
27173  return NULL;
27174  }
27175  return ts;
27176  case ' ':
27177  case '\r':
27178  case '\n':
27179  ++ts;
27180  break;
27181  case '<':
27182  if (!__Pyx_Is_Little_Endian()) {
27183  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
27184  return NULL;
27185  }
27186  ctx->new_packmode = '=';
27187  ++ts;
27188  break;
27189  case '>':
27190  case '!':
27191  if (__Pyx_Is_Little_Endian()) {
27192  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
27193  return NULL;
27194  }
27195  ctx->new_packmode = '=';
27196  ++ts;
27197  break;
27198  case '=':
27199  case '@':
27200  case '^':
27201  ctx->new_packmode = *ts++;
27202  break;
27203  case 'T':
27204  {
27205  const char* ts_after_sub;
27206  size_t i, struct_count = ctx->new_count;
27207  size_t struct_alignment = ctx->struct_alignment;
27208  ctx->new_count = 1;
27209  ++ts;
27210  if (*ts != '{') {
27211  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
27212  return NULL;
27213  }
27214  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27215  ctx->enc_type = 0;
27216  ctx->enc_count = 0;
27217  ctx->struct_alignment = 0;
27218  ++ts;
27219  ts_after_sub = ts;
27220  for (i = 0; i != struct_count; ++i) {
27221  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27222  if (!ts_after_sub) return NULL;
27223  }
27224  ts = ts_after_sub;
27225  if (struct_alignment) ctx->struct_alignment = struct_alignment;
27226  }
27227  break;
27228  case '}':
27229  {
27230  size_t alignment = ctx->struct_alignment;
27231  ++ts;
27232  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27233  ctx->enc_type = 0;
27234  if (alignment && ctx->fmt_offset % alignment) {
27235  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27236  }
27237  }
27238  return ts;
27239  case 'x':
27240  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27241  ctx->fmt_offset += ctx->new_count;
27242  ctx->new_count = 1;
27243  ctx->enc_count = 0;
27244  ctx->enc_type = 0;
27245  ctx->enc_packmode = ctx->new_packmode;
27246  ++ts;
27247  break;
27248  case 'Z':
27249  got_Z = 1;
27250  ++ts;
27251  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
27252  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
27253  return NULL;
27254  }
27255  CYTHON_FALLTHROUGH;
27256  case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
27257  case 'l': case 'L': case 'q': case 'Q':
27258  case 'f': case 'd': case 'g':
27259  case 'O': case 'p':
27260  if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
27261  ctx->enc_packmode == ctx->new_packmode) {
27262  ctx->enc_count += ctx->new_count;
27263  ctx->new_count = 1;
27264  got_Z = 0;
27265  ++ts;
27266  break;
27267  }
27268  CYTHON_FALLTHROUGH;
27269  case 's':
27270  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27271  ctx->enc_count = ctx->new_count;
27272  ctx->enc_packmode = ctx->new_packmode;
27273  ctx->enc_type = *ts;
27274  ctx->is_complex = got_Z;
27275  ++ts;
27276  ctx->new_count = 1;
27277  got_Z = 0;
27278  break;
27279  case ':':
27280  ++ts;
27281  while(*ts != ':') ++ts;
27282  ++ts;
27283  break;
27284  case '(':
27285  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
27286  break;
27287  default:
27288  {
27289  int number = __Pyx_BufFmt_ExpectNumber(&ts);
27290  if (number == -1) return NULL;
27291  ctx->new_count = (size_t)number;
27292  }
27293  }
27294  }
27295 }
27296 
27297 /* TypeInfoCompare */
27298  static int
27299 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27300 {
27301  int i;
27302  if (!a || !b)
27303  return 0;
27304  if (a == b)
27305  return 1;
27306  if (a->size != b->size || a->typegroup != b->typegroup ||
27307  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27308  if (a->typegroup == 'H' || b->typegroup == 'H') {
27309  return a->size == b->size;
27310  } else {
27311  return 0;
27312  }
27313  }
27314  if (a->ndim) {
27315  for (i = 0; i < a->ndim; i++)
27316  if (a->arraysize[i] != b->arraysize[i])
27317  return 0;
27318  }
27319  if (a->typegroup == 'S') {
27320  if (a->flags != b->flags)
27321  return 0;
27322  if (a->fields || b->fields) {
27323  if (!(a->fields && b->fields))
27324  return 0;
27325  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27326  __Pyx_StructField *field_a = a->fields + i;
27327  __Pyx_StructField *field_b = b->fields + i;
27328  if (field_a->offset != field_b->offset ||
27329  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27330  return 0;
27331  }
27332  return !a->fields[i].type && !b->fields[i].type;
27333  }
27334  }
27335  return 1;
27336 }
27337 
27338 /* MemviewSliceValidateAndInit */
27339  static int
27340 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
27341 {
27342  if (buf->shape[dim] <= 1)
27343  return 1;
27344  if (buf->strides) {
27345  if (spec & __Pyx_MEMVIEW_CONTIG) {
27346  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27347  if (buf->strides[dim] != sizeof(void *)) {
27348  PyErr_Format(PyExc_ValueError,
27349  "Buffer is not indirectly contiguous "
27350  "in dimension %d.", dim);
27351  goto fail;
27352  }
27353  } else if (buf->strides[dim] != buf->itemsize) {
27354  PyErr_SetString(PyExc_ValueError,
27355  "Buffer and memoryview are not contiguous "
27356  "in the same dimension.");
27357  goto fail;
27358  }
27359  }
27360  if (spec & __Pyx_MEMVIEW_FOLLOW) {
27361  Py_ssize_t stride = buf->strides[dim];
27362  if (stride < 0)
27363  stride = -stride;
27364  if (stride < buf->itemsize) {
27365  PyErr_SetString(PyExc_ValueError,
27366  "Buffer and memoryview are not contiguous "
27367  "in the same dimension.");
27368  goto fail;
27369  }
27370  }
27371  } else {
27372  if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
27373  PyErr_Format(PyExc_ValueError,
27374  "C-contiguous buffer is not contiguous in "
27375  "dimension %d", dim);
27376  goto fail;
27377  } else if (spec & (__Pyx_MEMVIEW_PTR)) {
27378  PyErr_Format(PyExc_ValueError,
27379  "C-contiguous buffer is not indirect in "
27380  "dimension %d", dim);
27381  goto fail;
27382  } else if (buf->suboffsets) {
27383  PyErr_SetString(PyExc_ValueError,
27384  "Buffer exposes suboffsets but no strides");
27385  goto fail;
27386  }
27387  }
27388  return 1;
27389 fail:
27390  return 0;
27391 }
27392 static int
27393 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
27394 {
27395  if (spec & __Pyx_MEMVIEW_DIRECT) {
27396  if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
27397  PyErr_Format(PyExc_ValueError,
27398  "Buffer not compatible with direct access "
27399  "in dimension %d.", dim);
27400  goto fail;
27401  }
27402  }
27403  if (spec & __Pyx_MEMVIEW_PTR) {
27404  if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
27405  PyErr_Format(PyExc_ValueError,
27406  "Buffer is not indirectly accessible "
27407  "in dimension %d.", dim);
27408  goto fail;
27409  }
27410  }
27411  return 1;
27412 fail:
27413  return 0;
27414 }
27415 static int
27416 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
27417 {
27418  int i;
27419  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27420  Py_ssize_t stride = 1;
27421  for (i = 0; i < ndim; i++) {
27422  if (stride * buf->itemsize != buf->strides[i] &&
27423  buf->shape[i] > 1)
27424  {
27425  PyErr_SetString(PyExc_ValueError,
27426  "Buffer not fortran contiguous.");
27427  goto fail;
27428  }
27429  stride = stride * buf->shape[i];
27430  }
27431  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27432  Py_ssize_t stride = 1;
27433  for (i = ndim - 1; i >- 1; i--) {
27434  if (stride * buf->itemsize != buf->strides[i] &&
27435  buf->shape[i] > 1) {
27436  PyErr_SetString(PyExc_ValueError,
27437  "Buffer not C contiguous.");
27438  goto fail;
27439  }
27440  stride = stride * buf->shape[i];
27441  }
27442  }
27443  return 1;
27444 fail:
27445  return 0;
27446 }
27447 static int __Pyx_ValidateAndInit_memviewslice(
27448  int *axes_specs,
27449  int c_or_f_flag,
27450  int buf_flags,
27451  int ndim,
27452  __Pyx_TypeInfo *dtype,
27453  __Pyx_BufFmt_StackElem stack[],
27454  __Pyx_memviewslice *memviewslice,
27455  PyObject *original_obj)
27456 {
27457  struct __pyx_memoryview_obj *memview, *new_memview;
27458  __Pyx_RefNannyDeclarations
27459  Py_buffer *buf;
27460  int i, spec = 0, retval = -1;
27461  __Pyx_BufFmt_Context ctx;
27462  int from_memoryview = __pyx_memoryview_check(original_obj);
27463  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
27464  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
27465  original_obj)->typeinfo)) {
27466  memview = (struct __pyx_memoryview_obj *) original_obj;
27467  new_memview = NULL;
27468  } else {
27469  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27470  original_obj, buf_flags, 0, dtype);
27471  new_memview = memview;
27472  if (unlikely(!memview))
27473  goto fail;
27474  }
27475  buf = &memview->view;
27476  if (buf->ndim != ndim) {
27477  PyErr_Format(PyExc_ValueError,
27478  "Buffer has wrong number of dimensions (expected %d, got %d)",
27479  ndim, buf->ndim);
27480  goto fail;
27481  }
27482  if (new_memview) {
27483  __Pyx_BufFmt_Init(&ctx, stack, dtype);
27484  if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
27485  }
27486  if ((unsigned) buf->itemsize != dtype->size) {
27487  PyErr_Format(PyExc_ValueError,
27488  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
27489  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
27490  buf->itemsize,
27491  (buf->itemsize > 1) ? "s" : "",
27492  dtype->name,
27493  dtype->size,
27494  (dtype->size > 1) ? "s" : "");
27495  goto fail;
27496  }
27497  for (i = 0; i < ndim; i++) {
27498  spec = axes_specs[i];
27499  if (!__pyx_check_strides(buf, i, ndim, spec))
27500  goto fail;
27501  if (!__pyx_check_suboffsets(buf, i, ndim, spec))
27502  goto fail;
27503  }
27504  if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
27505  goto fail;
27506  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27507  new_memview != NULL) == -1)) {
27508  goto fail;
27509  }
27510  retval = 0;
27511  goto no_fail;
27512 fail:
27513  Py_XDECREF(new_memview);
27514  retval = -1;
27515 no_fail:
27516  __Pyx_RefNannyFinishContext();
27517  return retval;
27518 }
27519 
27520 /* ObjectToMemviewSlice */
27521  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
27522  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27523  __Pyx_BufFmt_StackElem stack[1];
27524  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27525  int retcode;
27526  if (obj == Py_None) {
27527  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27528  return result;
27529  }
27530  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27531  PyBUF_RECORDS_RO | writable_flag, 1,
27532  &__Pyx_TypeInfo_double, stack,
27533  &result, obj);
27534  if (unlikely(retcode == -1))
27535  goto __pyx_fail;
27536  return result;
27537 __pyx_fail:
27538  result.memview = NULL;
27539  result.data = NULL;
27540  return result;
27541 }
27542 
27543 /* CIntToPy */
27544  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
27545  const int neg_one = (int) -1, const_zero = (int) 0;
27546  const int is_unsigned = neg_one > const_zero;
27547  if (is_unsigned) {
27548  if (sizeof(int) < sizeof(long)) {
27549  return PyInt_FromLong((long) value);
27550  } else if (sizeof(int) <= sizeof(unsigned long)) {
27551  return PyLong_FromUnsignedLong((unsigned long) value);
27552 #ifdef HAVE_LONG_LONG
27553  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27554  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27555 #endif
27556  }
27557  } else {
27558  if (sizeof(int) <= sizeof(long)) {
27559  return PyInt_FromLong((long) value);
27560 #ifdef HAVE_LONG_LONG
27561  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27562  return PyLong_FromLongLong((PY_LONG_LONG) value);
27563 #endif
27564  }
27565  }
27566  {
27567  int one = 1; int little = (int)*(unsigned char *)&one;
27568  unsigned char *bytes = (unsigned char *)&value;
27569  return _PyLong_FromByteArray(bytes, sizeof(int),
27570  little, !is_unsigned);
27571  }
27572 }
27573 
27574 /* CIntFromPyVerify */
27575  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27576  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27577 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27578  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27579 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27580  {\
27581  func_type value = func_value;\
27582  if (sizeof(target_type) < sizeof(func_type)) {\
27583  if (unlikely(value != (func_type) (target_type) value)) {\
27584  func_type zero = 0;\
27585  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27586  return (target_type) -1;\
27587  if (is_unsigned && unlikely(value < zero))\
27588  goto raise_neg_overflow;\
27589  else\
27590  goto raise_overflow;\
27591  }\
27592  }\
27593  return (target_type) value;\
27594  }
27595 
27596 /* CIntToPy */
27597  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
27598  const long neg_one = (long) -1, const_zero = (long) 0;
27599  const int is_unsigned = neg_one > const_zero;
27600  if (is_unsigned) {
27601  if (sizeof(long) < sizeof(long)) {
27602  return PyInt_FromLong((long) value);
27603  } else if (sizeof(long) <= sizeof(unsigned long)) {
27604  return PyLong_FromUnsignedLong((unsigned long) value);
27605 #ifdef HAVE_LONG_LONG
27606  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27607  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27608 #endif
27609  }
27610  } else {
27611  if (sizeof(long) <= sizeof(long)) {
27612  return PyInt_FromLong((long) value);
27613 #ifdef HAVE_LONG_LONG
27614  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27615  return PyLong_FromLongLong((PY_LONG_LONG) value);
27616 #endif
27617  }
27618  }
27619  {
27620  int one = 1; int little = (int)*(unsigned char *)&one;
27621  unsigned char *bytes = (unsigned char *)&value;
27622  return _PyLong_FromByteArray(bytes, sizeof(long),
27623  little, !is_unsigned);
27624  }
27625 }
27626 
27627 /* Declarations */
27628  #if CYTHON_CCOMPLEX
27629  #ifdef __cplusplus
27630  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27631  return ::std::complex< float >(x, y);
27632  }
27633  #else
27634  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27635  return x + y*(__pyx_t_float_complex)_Complex_I;
27636  }
27637  #endif
27638 #else
27639  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27640  __pyx_t_float_complex z;
27641  z.real = x;
27642  z.imag = y;
27643  return z;
27644  }
27645 #endif
27646 
27647 /* Arithmetic */
27648  #if CYTHON_CCOMPLEX
27649 #else
27650  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27651  return (a.real == b.real) && (a.imag == b.imag);
27652  }
27653  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27654  __pyx_t_float_complex z;
27655  z.real = a.real + b.real;
27656  z.imag = a.imag + b.imag;
27657  return z;
27658  }
27659  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27660  __pyx_t_float_complex z;
27661  z.real = a.real - b.real;
27662  z.imag = a.imag - b.imag;
27663  return z;
27664  }
27665  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27666  __pyx_t_float_complex z;
27667  z.real = a.real * b.real - a.imag * b.imag;
27668  z.imag = a.real * b.imag + a.imag * b.real;
27669  return z;
27670  }
27671  #if 1
27672  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27673  if (b.imag == 0) {
27674  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27675  } else if (fabsf(b.real) >= fabsf(b.imag)) {
27676  if (b.real == 0 && b.imag == 0) {
27677  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27678  } else {
27679  float r = b.imag / b.real;
27680  float s = 1.0 / (b.real + b.imag * r);
27681  return __pyx_t_float_complex_from_parts(
27682  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27683  }
27684  } else {
27685  float r = b.real / b.imag;
27686  float s = 1.0 / (b.imag + b.real * r);
27687  return __pyx_t_float_complex_from_parts(
27688  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27689  }
27690  }
27691  #else
27692  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27693  if (b.imag == 0) {
27694  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27695  } else {
27696  float denom = b.real * b.real + b.imag * b.imag;
27697  return __pyx_t_float_complex_from_parts(
27698  (a.real * b.real + a.imag * b.imag) / denom,
27699  (a.imag * b.real - a.real * b.imag) / denom);
27700  }
27701  }
27702  #endif
27703  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27704  __pyx_t_float_complex z;
27705  z.real = -a.real;
27706  z.imag = -a.imag;
27707  return z;
27708  }
27709  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27710  return (a.real == 0) && (a.imag == 0);
27711  }
27712  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27713  __pyx_t_float_complex z;
27714  z.real = a.real;
27715  z.imag = -a.imag;
27716  return z;
27717  }
27718  #if 1
27719  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
27720  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27721  return sqrtf(z.real*z.real + z.imag*z.imag);
27722  #else
27723  return hypotf(z.real, z.imag);
27724  #endif
27725  }
27726  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27727  __pyx_t_float_complex z;
27728  float r, lnr, theta, z_r, z_theta;
27729  if (b.imag == 0 && b.real == (int)b.real) {
27730  if (b.real < 0) {
27731  float denom = a.real * a.real + a.imag * a.imag;
27732  a.real = a.real / denom;
27733  a.imag = -a.imag / denom;
27734  b.real = -b.real;
27735  }
27736  switch ((int)b.real) {
27737  case 0:
27738  z.real = 1;
27739  z.imag = 0;
27740  return z;
27741  case 1:
27742  return a;
27743  case 2:
27744  z = __Pyx_c_prod_float(a, a);
27745  return __Pyx_c_prod_float(a, a);
27746  case 3:
27747  z = __Pyx_c_prod_float(a, a);
27748  return __Pyx_c_prod_float(z, a);
27749  case 4:
27750  z = __Pyx_c_prod_float(a, a);
27751  return __Pyx_c_prod_float(z, z);
27752  }
27753  }
27754  if (a.imag == 0) {
27755  if (a.real == 0) {
27756  return a;
27757  } else if (b.imag == 0) {
27758  z.real = powf(a.real, b.real);
27759  z.imag = 0;
27760  return z;
27761  } else if (a.real > 0) {
27762  r = a.real;
27763  theta = 0;
27764  } else {
27765  r = -a.real;
27766  theta = atan2f(0, -1);
27767  }
27768  } else {
27769  r = __Pyx_c_abs_float(a);
27770  theta = atan2f(a.imag, a.real);
27771  }
27772  lnr = logf(r);
27773  z_r = expf(lnr * b.real - theta * b.imag);
27774  z_theta = theta * b.real + lnr * b.imag;
27775  z.real = z_r * cosf(z_theta);
27776  z.imag = z_r * sinf(z_theta);
27777  return z;
27778  }
27779  #endif
27780 #endif
27781 
27782 /* Declarations */
27783  #if CYTHON_CCOMPLEX
27784  #ifdef __cplusplus
27785  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27786  return ::std::complex< double >(x, y);
27787  }
27788  #else
27789  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27790  return x + y*(__pyx_t_double_complex)_Complex_I;
27791  }
27792  #endif
27793 #else
27794  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27795  __pyx_t_double_complex z;
27796  z.real = x;
27797  z.imag = y;
27798  return z;
27799  }
27800 #endif
27801 
27802 /* Arithmetic */
27803  #if CYTHON_CCOMPLEX
27804 #else
27805  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27806  return (a.real == b.real) && (a.imag == b.imag);
27807  }
27808  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27809  __pyx_t_double_complex z;
27810  z.real = a.real + b.real;
27811  z.imag = a.imag + b.imag;
27812  return z;
27813  }
27814  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27815  __pyx_t_double_complex z;
27816  z.real = a.real - b.real;
27817  z.imag = a.imag - b.imag;
27818  return z;
27819  }
27820  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27821  __pyx_t_double_complex z;
27822  z.real = a.real * b.real - a.imag * b.imag;
27823  z.imag = a.real * b.imag + a.imag * b.real;
27824  return z;
27825  }
27826  #if 1
27827  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27828  if (b.imag == 0) {
27829  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27830  } else if (fabs(b.real) >= fabs(b.imag)) {
27831  if (b.real == 0 && b.imag == 0) {
27832  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27833  } else {
27834  double r = b.imag / b.real;
27835  double s = 1.0 / (b.real + b.imag * r);
27836  return __pyx_t_double_complex_from_parts(
27837  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27838  }
27839  } else {
27840  double r = b.real / b.imag;
27841  double s = 1.0 / (b.imag + b.real * r);
27842  return __pyx_t_double_complex_from_parts(
27843  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27844  }
27845  }
27846  #else
27847  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27848  if (b.imag == 0) {
27849  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27850  } else {
27851  double denom = b.real * b.real + b.imag * b.imag;
27852  return __pyx_t_double_complex_from_parts(
27853  (a.real * b.real + a.imag * b.imag) / denom,
27854  (a.imag * b.real - a.real * b.imag) / denom);
27855  }
27856  }
27857  #endif
27858  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27859  __pyx_t_double_complex z;
27860  z.real = -a.real;
27861  z.imag = -a.imag;
27862  return z;
27863  }
27864  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27865  return (a.real == 0) && (a.imag == 0);
27866  }
27867  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27868  __pyx_t_double_complex z;
27869  z.real = a.real;
27870  z.imag = -a.imag;
27871  return z;
27872  }
27873  #if 1
27874  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
27875  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27876  return sqrt(z.real*z.real + z.imag*z.imag);
27877  #else
27878  return hypot(z.real, z.imag);
27879  #endif
27880  }
27881  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27882  __pyx_t_double_complex z;
27883  double r, lnr, theta, z_r, z_theta;
27884  if (b.imag == 0 && b.real == (int)b.real) {
27885  if (b.real < 0) {
27886  double denom = a.real * a.real + a.imag * a.imag;
27887  a.real = a.real / denom;
27888  a.imag = -a.imag / denom;
27889  b.real = -b.real;
27890  }
27891  switch ((int)b.real) {
27892  case 0:
27893  z.real = 1;
27894  z.imag = 0;
27895  return z;
27896  case 1:
27897  return a;
27898  case 2:
27899  z = __Pyx_c_prod_double(a, a);
27900  return __Pyx_c_prod_double(a, a);
27901  case 3:
27902  z = __Pyx_c_prod_double(a, a);
27903  return __Pyx_c_prod_double(z, a);
27904  case 4:
27905  z = __Pyx_c_prod_double(a, a);
27906  return __Pyx_c_prod_double(z, z);
27907  }
27908  }
27909  if (a.imag == 0) {
27910  if (a.real == 0) {
27911  return a;
27912  } else if (b.imag == 0) {
27913  z.real = pow(a.real, b.real);
27914  z.imag = 0;
27915  return z;
27916  } else if (a.real > 0) {
27917  r = a.real;
27918  theta = 0;
27919  } else {
27920  r = -a.real;
27921  theta = atan2(0, -1);
27922  }
27923  } else {
27924  r = __Pyx_c_abs_double(a);
27925  theta = atan2(a.imag, a.real);
27926  }
27927  lnr = log(r);
27928  z_r = exp(lnr * b.real - theta * b.imag);
27929  z_theta = theta * b.real + lnr * b.imag;
27930  z.real = z_r * cos(z_theta);
27931  z.imag = z_r * sin(z_theta);
27932  return z;
27933  }
27934  #endif
27935 #endif
27936 
27937 /* CIntToPy */
27938  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
27939  const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
27940  const int is_unsigned = neg_one > const_zero;
27941  if (is_unsigned) {
27942  if (sizeof(enum NPY_TYPES) < sizeof(long)) {
27943  return PyInt_FromLong((long) value);
27944  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
27945  return PyLong_FromUnsignedLong((unsigned long) value);
27946 #ifdef HAVE_LONG_LONG
27947  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
27948  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27949 #endif
27950  }
27951  } else {
27952  if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
27953  return PyInt_FromLong((long) value);
27954 #ifdef HAVE_LONG_LONG
27955  } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
27956  return PyLong_FromLongLong((PY_LONG_LONG) value);
27957 #endif
27958  }
27959  }
27960  {
27961  int one = 1; int little = (int)*(unsigned char *)&one;
27962  unsigned char *bytes = (unsigned char *)&value;
27963  return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
27964  little, !is_unsigned);
27965  }
27966 }
27967 
27968 /* MemviewSliceCopyTemplate */
27969  static __Pyx_memviewslice
27970 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
27971  const char *mode, int ndim,
27972  size_t sizeof_dtype, int contig_flag,
27973  int dtype_is_object)
27974 {
27975  __Pyx_RefNannyDeclarations
27976  int i;
27977  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27978  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27979  Py_buffer *buf = &from_memview->view;
27980  PyObject *shape_tuple = NULL;
27981  PyObject *temp_int = NULL;
27982  struct __pyx_array_obj *array_obj = NULL;
27983  struct __pyx_memoryview_obj *memview_obj = NULL;
27984  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
27985  for (i = 0; i < ndim; i++) {
27986  if (from_mvs->suboffsets[i] >= 0) {
27987  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
27988  "indirect dimensions (axis %d)", i);
27989  goto fail;
27990  }
27991  }
27992  shape_tuple = PyTuple_New(ndim);
27993  if (unlikely(!shape_tuple)) {
27994  goto fail;
27995  }
27996  __Pyx_GOTREF(shape_tuple);
27997  for(i = 0; i < ndim; i++) {
27998  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27999  if(unlikely(!temp_int)) {
28000  goto fail;
28001  } else {
28002  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
28003  temp_int = NULL;
28004  }
28005  }
28006  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
28007  if (unlikely(!array_obj)) {
28008  goto fail;
28009  }
28010  __Pyx_GOTREF(array_obj);
28011  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28012  (PyObject *) array_obj, contig_flag,
28013  dtype_is_object,
28014  from_mvs->memview->typeinfo);
28015  if (unlikely(!memview_obj))
28016  goto fail;
28017  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
28018  goto fail;
28019  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
28020  dtype_is_object) < 0))
28021  goto fail;
28022  goto no_fail;
28023 fail:
28024  __Pyx_XDECREF(new_mvs.memview);
28025  new_mvs.memview = NULL;
28026  new_mvs.data = NULL;
28027 no_fail:
28028  __Pyx_XDECREF(shape_tuple);
28029  __Pyx_XDECREF(temp_int);
28030  __Pyx_XDECREF(array_obj);
28031  __Pyx_RefNannyFinishContext();
28032  return new_mvs;
28033 }
28034 
28035 /* CIntFromPy */
28036  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
28037  const int neg_one = (int) -1, const_zero = (int) 0;
28038  const int is_unsigned = neg_one > const_zero;
28039 #if PY_MAJOR_VERSION < 3
28040  if (likely(PyInt_Check(x))) {
28041  if (sizeof(int) < sizeof(long)) {
28042  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
28043  } else {
28044  long val = PyInt_AS_LONG(x);
28045  if (is_unsigned && unlikely(val < 0)) {
28046  goto raise_neg_overflow;
28047  }
28048  return (int) val;
28049  }
28050  } else
28051 #endif
28052  if (likely(PyLong_Check(x))) {
28053  if (is_unsigned) {
28054 #if CYTHON_USE_PYLONG_INTERNALS
28055  const digit* digits = ((PyLongObject*)x)->ob_digit;
28056  switch (Py_SIZE(x)) {
28057  case 0: return (int) 0;
28058  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
28059  case 2:
28060  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
28061  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28062  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28063  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
28064  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28065  }
28066  }
28067  break;
28068  case 3:
28069  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28070  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28071  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28072  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
28073  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28074  }
28075  }
28076  break;
28077  case 4:
28078  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28079  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28080  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28081  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
28082  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28083  }
28084  }
28085  break;
28086  }
28087 #endif
28088 #if CYTHON_COMPILING_IN_CPYTHON
28089  if (unlikely(Py_SIZE(x) < 0)) {
28090  goto raise_neg_overflow;
28091  }
28092 #else
28093  {
28094  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28095  if (unlikely(result < 0))
28096  return (int) -1;
28097  if (unlikely(result == 1))
28098  goto raise_neg_overflow;
28099  }
28100 #endif
28101  if (sizeof(int) <= sizeof(unsigned long)) {
28102  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
28103 #ifdef HAVE_LONG_LONG
28104  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28105  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28106 #endif
28107  }
28108  } else {
28109 #if CYTHON_USE_PYLONG_INTERNALS
28110  const digit* digits = ((PyLongObject*)x)->ob_digit;
28111  switch (Py_SIZE(x)) {
28112  case 0: return (int) 0;
28113  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
28114  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
28115  case -2:
28116  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
28117  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28118  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28119  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28120  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28121  }
28122  }
28123  break;
28124  case 2:
28125  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
28126  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28127  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28128  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28129  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28130  }
28131  }
28132  break;
28133  case -3:
28134  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28135  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28136  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28137  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28138  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28139  }
28140  }
28141  break;
28142  case 3:
28143  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28144  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28145  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28146  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28147  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28148  }
28149  }
28150  break;
28151  case -4:
28152  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28153  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28154  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28155  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28156  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28157  }
28158  }
28159  break;
28160  case 4:
28161  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28162  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28163  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28164  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28165  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28166  }
28167  }
28168  break;
28169  }
28170 #endif
28171  if (sizeof(int) <= sizeof(long)) {
28172  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
28173 #ifdef HAVE_LONG_LONG
28174  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28175  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
28176 #endif
28177  }
28178  }
28179  {
28180 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28181  PyErr_SetString(PyExc_RuntimeError,
28182  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28183 #else
28184  int val;
28185  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28186  #if PY_MAJOR_VERSION < 3
28187  if (likely(v) && !PyLong_Check(v)) {
28188  PyObject *tmp = v;
28189  v = PyNumber_Long(tmp);
28190  Py_DECREF(tmp);
28191  }
28192  #endif
28193  if (likely(v)) {
28194  int one = 1; int is_little = (int)*(unsigned char *)&one;
28195  unsigned char *bytes = (unsigned char *)&val;
28196  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28197  bytes, sizeof(val),
28198  is_little, !is_unsigned);
28199  Py_DECREF(v);
28200  if (likely(!ret))
28201  return val;
28202  }
28203 #endif
28204  return (int) -1;
28205  }
28206  } else {
28207  int val;
28208  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28209  if (!tmp) return (int) -1;
28210  val = __Pyx_PyInt_As_int(tmp);
28211  Py_DECREF(tmp);
28212  return val;
28213  }
28214 raise_overflow:
28215  PyErr_SetString(PyExc_OverflowError,
28216  "value too large to convert to int");
28217  return (int) -1;
28218 raise_neg_overflow:
28219  PyErr_SetString(PyExc_OverflowError,
28220  "can't convert negative value to int");
28221  return (int) -1;
28222 }
28223 
28224 /* CIntFromPy */
28225  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
28226  const long neg_one = (long) -1, const_zero = (long) 0;
28227  const int is_unsigned = neg_one > const_zero;
28228 #if PY_MAJOR_VERSION < 3
28229  if (likely(PyInt_Check(x))) {
28230  if (sizeof(long) < sizeof(long)) {
28231  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
28232  } else {
28233  long val = PyInt_AS_LONG(x);
28234  if (is_unsigned && unlikely(val < 0)) {
28235  goto raise_neg_overflow;
28236  }
28237  return (long) val;
28238  }
28239  } else
28240 #endif
28241  if (likely(PyLong_Check(x))) {
28242  if (is_unsigned) {
28243 #if CYTHON_USE_PYLONG_INTERNALS
28244  const digit* digits = ((PyLongObject*)x)->ob_digit;
28245  switch (Py_SIZE(x)) {
28246  case 0: return (long) 0;
28247  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
28248  case 2:
28249  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28250  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28251  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28252  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
28253  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28254  }
28255  }
28256  break;
28257  case 3:
28258  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28259  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28260  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28261  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
28262  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28263  }
28264  }
28265  break;
28266  case 4:
28267  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28268  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28269  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28270  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
28271  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28272  }
28273  }
28274  break;
28275  }
28276 #endif
28277 #if CYTHON_COMPILING_IN_CPYTHON
28278  if (unlikely(Py_SIZE(x) < 0)) {
28279  goto raise_neg_overflow;
28280  }
28281 #else
28282  {
28283  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28284  if (unlikely(result < 0))
28285  return (long) -1;
28286  if (unlikely(result == 1))
28287  goto raise_neg_overflow;
28288  }
28289 #endif
28290  if (sizeof(long) <= sizeof(unsigned long)) {
28291  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
28292 #ifdef HAVE_LONG_LONG
28293  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28294  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28295 #endif
28296  }
28297  } else {
28298 #if CYTHON_USE_PYLONG_INTERNALS
28299  const digit* digits = ((PyLongObject*)x)->ob_digit;
28300  switch (Py_SIZE(x)) {
28301  case 0: return (long) 0;
28302  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
28303  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
28304  case -2:
28305  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
28306  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28307  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28308  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28309  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28310  }
28311  }
28312  break;
28313  case 2:
28314  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28315  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28316  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28317  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28318  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28319  }
28320  }
28321  break;
28322  case -3:
28323  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28324  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28325  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28326  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28327  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28328  }
28329  }
28330  break;
28331  case 3:
28332  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28333  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28334  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28335  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28336  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28337  }
28338  }
28339  break;
28340  case -4:
28341  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28342  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28343  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28344  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28345  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28346  }
28347  }
28348  break;
28349  case 4:
28350  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28351  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28352  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28353  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28354  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28355  }
28356  }
28357  break;
28358  }
28359 #endif
28360  if (sizeof(long) <= sizeof(long)) {
28361  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
28362 #ifdef HAVE_LONG_LONG
28363  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28364  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
28365 #endif
28366  }
28367  }
28368  {
28369 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28370  PyErr_SetString(PyExc_RuntimeError,
28371  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28372 #else
28373  long val;
28374  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28375  #if PY_MAJOR_VERSION < 3
28376  if (likely(v) && !PyLong_Check(v)) {
28377  PyObject *tmp = v;
28378  v = PyNumber_Long(tmp);
28379  Py_DECREF(tmp);
28380  }
28381  #endif
28382  if (likely(v)) {
28383  int one = 1; int is_little = (int)*(unsigned char *)&one;
28384  unsigned char *bytes = (unsigned char *)&val;
28385  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28386  bytes, sizeof(val),
28387  is_little, !is_unsigned);
28388  Py_DECREF(v);
28389  if (likely(!ret))
28390  return val;
28391  }
28392 #endif
28393  return (long) -1;
28394  }
28395  } else {
28396  long val;
28397  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28398  if (!tmp) return (long) -1;
28399  val = __Pyx_PyInt_As_long(tmp);
28400  Py_DECREF(tmp);
28401  return val;
28402  }
28403 raise_overflow:
28404  PyErr_SetString(PyExc_OverflowError,
28405  "value too large to convert to long");
28406  return (long) -1;
28407 raise_neg_overflow:
28408  PyErr_SetString(PyExc_OverflowError,
28409  "can't convert negative value to long");
28410  return (long) -1;
28411 }
28412 
28413 /* CIntFromPy */
28414  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
28415  const char neg_one = (char) -1, const_zero = (char) 0;
28416  const int is_unsigned = neg_one > const_zero;
28417 #if PY_MAJOR_VERSION < 3
28418  if (likely(PyInt_Check(x))) {
28419  if (sizeof(char) < sizeof(long)) {
28420  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
28421  } else {
28422  long val = PyInt_AS_LONG(x);
28423  if (is_unsigned && unlikely(val < 0)) {
28424  goto raise_neg_overflow;
28425  }
28426  return (char) val;
28427  }
28428  } else
28429 #endif
28430  if (likely(PyLong_Check(x))) {
28431  if (is_unsigned) {
28432 #if CYTHON_USE_PYLONG_INTERNALS
28433  const digit* digits = ((PyLongObject*)x)->ob_digit;
28434  switch (Py_SIZE(x)) {
28435  case 0: return (char) 0;
28436  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
28437  case 2:
28438  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28439  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28440  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28441  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
28442  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28443  }
28444  }
28445  break;
28446  case 3:
28447  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28448  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28449  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28450  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
28451  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28452  }
28453  }
28454  break;
28455  case 4:
28456  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28457  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28458  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28459  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
28460  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28461  }
28462  }
28463  break;
28464  }
28465 #endif
28466 #if CYTHON_COMPILING_IN_CPYTHON
28467  if (unlikely(Py_SIZE(x) < 0)) {
28468  goto raise_neg_overflow;
28469  }
28470 #else
28471  {
28472  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28473  if (unlikely(result < 0))
28474  return (char) -1;
28475  if (unlikely(result == 1))
28476  goto raise_neg_overflow;
28477  }
28478 #endif
28479  if (sizeof(char) <= sizeof(unsigned long)) {
28480  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
28481 #ifdef HAVE_LONG_LONG
28482  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
28483  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28484 #endif
28485  }
28486  } else {
28487 #if CYTHON_USE_PYLONG_INTERNALS
28488  const digit* digits = ((PyLongObject*)x)->ob_digit;
28489  switch (Py_SIZE(x)) {
28490  case 0: return (char) 0;
28491  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
28492  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
28493  case -2:
28494  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
28495  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28496  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28497  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28498  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28499  }
28500  }
28501  break;
28502  case 2:
28503  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28504  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28505  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28506  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28507  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28508  }
28509  }
28510  break;
28511  case -3:
28512  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28513  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28514  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28515  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28516  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28517  }
28518  }
28519  break;
28520  case 3:
28521  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28522  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28523  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28524  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28525  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28526  }
28527  }
28528  break;
28529  case -4:
28530  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28531  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28532  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28533  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28534  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28535  }
28536  }
28537  break;
28538  case 4:
28539  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28540  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28541  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28542  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28543  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28544  }
28545  }
28546  break;
28547  }
28548 #endif
28549  if (sizeof(char) <= sizeof(long)) {
28550  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
28551 #ifdef HAVE_LONG_LONG
28552  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
28553  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
28554 #endif
28555  }
28556  }
28557  {
28558 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28559  PyErr_SetString(PyExc_RuntimeError,
28560  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28561 #else
28562  char val;
28563  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28564  #if PY_MAJOR_VERSION < 3
28565  if (likely(v) && !PyLong_Check(v)) {
28566  PyObject *tmp = v;
28567  v = PyNumber_Long(tmp);
28568  Py_DECREF(tmp);
28569  }
28570  #endif
28571  if (likely(v)) {
28572  int one = 1; int is_little = (int)*(unsigned char *)&one;
28573  unsigned char *bytes = (unsigned char *)&val;
28574  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28575  bytes, sizeof(val),
28576  is_little, !is_unsigned);
28577  Py_DECREF(v);
28578  if (likely(!ret))
28579  return val;
28580  }
28581 #endif
28582  return (char) -1;
28583  }
28584  } else {
28585  char val;
28586  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28587  if (!tmp) return (char) -1;
28588  val = __Pyx_PyInt_As_char(tmp);
28589  Py_DECREF(tmp);
28590  return val;
28591  }
28592 raise_overflow:
28593  PyErr_SetString(PyExc_OverflowError,
28594  "value too large to convert to char");
28595  return (char) -1;
28596 raise_neg_overflow:
28597  PyErr_SetString(PyExc_OverflowError,
28598  "can't convert negative value to char");
28599  return (char) -1;
28600 }
28601 
28602 /* CheckBinaryVersion */
28603  static int __Pyx_check_binary_version(void) {
28604  char ctversion[4], rtversion[4];
28605  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28606  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
28607  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
28608  char message[200];
28609  PyOS_snprintf(message, sizeof(message),
28610  "compiletime version %s of module '%.100s' "
28611  "does not match runtime version %s",
28612  ctversion, __Pyx_MODULE_NAME, rtversion);
28613  return PyErr_WarnEx(NULL, message, 1);
28614  }
28615  return 0;
28616 }
28617 
28618 /* ModuleImport */
28619  #ifndef __PYX_HAVE_RT_ImportModule
28620 #define __PYX_HAVE_RT_ImportModule
28621 static PyObject *__Pyx_ImportModule(const char *name) {
28622  PyObject *py_name = 0;
28623  PyObject *py_module = 0;
28624  py_name = __Pyx_PyIdentifier_FromString(name);
28625  if (!py_name)
28626  goto bad;
28627  py_module = PyImport_Import(py_name);
28628  Py_DECREF(py_name);
28629  return py_module;
28630 bad:
28631  Py_XDECREF(py_name);
28632  return 0;
28633 }
28634 #endif
28635 
28636 /* TypeImport */
28637  #ifndef __PYX_HAVE_RT_ImportType
28638 #define __PYX_HAVE_RT_ImportType
28639 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
28640  size_t size, int strict)
28641 {
28642  PyObject *py_module = 0;
28643  PyObject *result = 0;
28644  PyObject *py_name = 0;
28645  char warning[200];
28646  Py_ssize_t basicsize;
28647 #ifdef Py_LIMITED_API
28648  PyObject *py_basicsize;
28649 #endif
28650  py_module = __Pyx_ImportModule(module_name);
28651  if (!py_module)
28652  goto bad;
28653  py_name = __Pyx_PyIdentifier_FromString(class_name);
28654  if (!py_name)
28655  goto bad;
28656  result = PyObject_GetAttr(py_module, py_name);
28657  Py_DECREF(py_name);
28658  py_name = 0;
28659  Py_DECREF(py_module);
28660  py_module = 0;
28661  if (!result)
28662  goto bad;
28663  if (!PyType_Check(result)) {
28664  PyErr_Format(PyExc_TypeError,
28665  "%.200s.%.200s is not a type object",
28666  module_name, class_name);
28667  goto bad;
28668  }
28669 #ifndef Py_LIMITED_API
28670  basicsize = ((PyTypeObject *)result)->tp_basicsize;
28671 #else
28672  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
28673  if (!py_basicsize)
28674  goto bad;
28675  basicsize = PyLong_AsSsize_t(py_basicsize);
28676  Py_DECREF(py_basicsize);
28677  py_basicsize = 0;
28678  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
28679  goto bad;
28680 #endif
28681  if (!strict && (size_t)basicsize > size) {
28682  PyOS_snprintf(warning, sizeof(warning),
28683  "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
28684  module_name, class_name, basicsize, size);
28685  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
28686  }
28687  else if ((size_t)basicsize != size) {
28688  PyErr_Format(PyExc_ValueError,
28689  "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
28690  module_name, class_name, basicsize, size);
28691  goto bad;
28692  }
28693  return (PyTypeObject *)result;
28694 bad:
28695  Py_XDECREF(py_module);
28696  Py_XDECREF(result);
28697  return NULL;
28698 }
28699 #endif
28700 
28701 /* InitStrings */
28702  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28703  while (t->p) {
28704  #if PY_MAJOR_VERSION < 3
28705  if (t->is_unicode) {
28706  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28707  } else if (t->intern) {
28708  *t->p = PyString_InternFromString(t->s);
28709  } else {
28710  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28711  }
28712  #else
28713  if (t->is_unicode | t->is_str) {
28714  if (t->intern) {
28715  *t->p = PyUnicode_InternFromString(t->s);
28716  } else if (t->encoding) {
28717  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28718  } else {
28719  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28720  }
28721  } else {
28722  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28723  }
28724  #endif
28725  if (!*t->p)
28726  return -1;
28727  if (PyObject_Hash(*t->p) == -1)
28728  return -1;
28729  ++t;
28730  }
28731  return 0;
28732 }
28733 
28734 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
28735  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
28736 }
28737 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
28738  Py_ssize_t ignore;
28739  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28740 }
28741 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28742 #if !CYTHON_PEP393_ENABLED
28743 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28744  char* defenc_c;
28745  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
28746  if (!defenc) return NULL;
28747  defenc_c = PyBytes_AS_STRING(defenc);
28748 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28749  {
28750  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28751  char* c;
28752  for (c = defenc_c; c < end; c++) {
28753  if ((unsigned char) (*c) >= 128) {
28754  PyUnicode_AsASCIIString(o);
28755  return NULL;
28756  }
28757  }
28758  }
28759 #endif
28760  *length = PyBytes_GET_SIZE(defenc);
28761  return defenc_c;
28762 }
28763 #else
28764 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28765  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
28766 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28767  if (likely(PyUnicode_IS_ASCII(o))) {
28768  *length = PyUnicode_GET_LENGTH(o);
28769  return PyUnicode_AsUTF8(o);
28770  } else {
28771  PyUnicode_AsASCIIString(o);
28772  return NULL;
28773  }
28774 #else
28775  return PyUnicode_AsUTF8AndSize(o, length);
28776 #endif
28777 }
28778 #endif
28779 #endif
28780 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28781 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28782  if (
28783 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28784  __Pyx_sys_getdefaultencoding_not_ascii &&
28785 #endif
28786  PyUnicode_Check(o)) {
28787  return __Pyx_PyUnicode_AsStringAndSize(o, length);
28788  } else
28789 #endif
28790 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
28791  if (PyByteArray_Check(o)) {
28792  *length = PyByteArray_GET_SIZE(o);
28793  return PyByteArray_AS_STRING(o);
28794  } else
28795 #endif
28796  {
28797  char* result;
28798  int r = PyBytes_AsStringAndSize(o, &result, length);
28799  if (unlikely(r < 0)) {
28800  return NULL;
28801  } else {
28802  return result;
28803  }
28804  }
28805 }
28806 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
28807  int is_true = x == Py_True;
28808  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
28809  else return PyObject_IsTrue(x);
28810 }
28811 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
28812 #if PY_MAJOR_VERSION >= 3
28813  if (PyLong_Check(result)) {
28814  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
28815  "__int__ returned non-int (type %.200s). "
28816  "The ability to return an instance of a strict subclass of int "
28817  "is deprecated, and may be removed in a future version of Python.",
28818  Py_TYPE(result)->tp_name)) {
28819  Py_DECREF(result);
28820  return NULL;
28821  }
28822  return result;
28823  }
28824 #endif
28825  PyErr_Format(PyExc_TypeError,
28826  "__%.4s__ returned non-%.4s (type %.200s)",
28827  type_name, type_name, Py_TYPE(result)->tp_name);
28828  Py_DECREF(result);
28829  return NULL;
28830 }
28831 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28832 #if CYTHON_USE_TYPE_SLOTS
28833  PyNumberMethods *m;
28834 #endif
28835  const char *name = NULL;
28836  PyObject *res = NULL;
28837 #if PY_MAJOR_VERSION < 3
28838  if (likely(PyInt_Check(x) || PyLong_Check(x)))
28839 #else
28840  if (likely(PyLong_Check(x)))
28841 #endif
28842  return __Pyx_NewRef(x);
28843 #if CYTHON_USE_TYPE_SLOTS
28844  m = Py_TYPE(x)->tp_as_number;
28845  #if PY_MAJOR_VERSION < 3
28846  if (m && m->nb_int) {
28847  name = "int";
28848  res = m->nb_int(x);
28849  }
28850  else if (m && m->nb_long) {
28851  name = "long";
28852  res = m->nb_long(x);
28853  }
28854  #else
28855  if (likely(m && m->nb_int)) {
28856  name = "int";
28857  res = m->nb_int(x);
28858  }
28859  #endif
28860 #else
28861  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28862  res = PyNumber_Int(x);
28863  }
28864 #endif
28865  if (likely(res)) {
28866 #if PY_MAJOR_VERSION < 3
28867  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28868 #else
28869  if (unlikely(!PyLong_CheckExact(res))) {
28870 #endif
28871  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28872  }
28873  }
28874  else if (!PyErr_Occurred()) {
28875  PyErr_SetString(PyExc_TypeError,
28876  "an integer is required");
28877  }
28878  return res;
28879 }
28880 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28881  Py_ssize_t ival;
28882  PyObject *x;
28883 #if PY_MAJOR_VERSION < 3
28884  if (likely(PyInt_CheckExact(b))) {
28885  if (sizeof(Py_ssize_t) >= sizeof(long))
28886  return PyInt_AS_LONG(b);
28887  else
28888  return PyInt_AsSsize_t(x);
28889  }
28890 #endif
28891  if (likely(PyLong_CheckExact(b))) {
28892  #if CYTHON_USE_PYLONG_INTERNALS
28893  const digit* digits = ((PyLongObject*)b)->ob_digit;
28894  const Py_ssize_t size = Py_SIZE(b);
28895  if (likely(__Pyx_sst_abs(size) <= 1)) {
28896  ival = likely(size) ? digits[0] : 0;
28897  if (size == -1) ival = -ival;
28898  return ival;
28899  } else {
28900  switch (size) {
28901  case 2:
28902  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28903  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28904  }
28905  break;
28906  case -2:
28907  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28908  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28909  }
28910  break;
28911  case 3:
28912  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28913  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28914  }
28915  break;
28916  case -3:
28917  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28918  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28919  }
28920  break;
28921  case 4:
28922  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28923  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28924  }
28925  break;
28926  case -4:
28927  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28928  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28929  }
28930  break;
28931  }
28932  }
28933  #endif
28934  return PyLong_AsSsize_t(b);
28935  }
28936  x = PyNumber_Index(b);
28937  if (!x) return -1;
28938  ival = PyInt_AsSsize_t(x);
28939  Py_DECREF(x);
28940  return ival;
28941 }
28942 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
28943  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28944 }
28945 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
28946  return PyInt_FromSize_t(ival);
28947 }
28948 
28949 
28950 #endif /* Py_PYTHON_H */
f
Double f
Definition: Headers.h:64
number
Int number
Definition: Headers.h:33
s
Double s
Definition: Headers.h:84
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
c
Double c
Definition: Headers.h:54
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8